Versions in this module Expand all Collapse all v1 v1.5.0 Oct 24, 2022 Changes in this version + const DefaultStringLen + const MaxTypes + const Null + const PrimaryKey + const TypeTable + const UniqueKey + type Column struct + Attr string + Default interface{} + Enums []string + Increment bool + Key string + Name string + Nullable bool + SchemaType map[string]string + Size int64 + Type field.Type + Unique bool + func (c *Column) ConvertibleTo(d *Column) bool + func (c *Column) PrimaryKey() bool + func (c *Column) ScanDefault(value string) error + func (c *Column) UniqueKey() bool + func (c Column) FloatType() bool + func (c Column) IntType() bool + func (c Column) UintType() bool + type ForeignKey struct + Columns []*Column + OnDelete ReferenceOption + OnUpdate ReferenceOption + RefColumns []*Column + RefTable *Table + Symbol string + func (fk ForeignKey) DSL() *sql.ForeignKeyBuilder + type Index struct + Columns []*Column + Name string + Unique bool + func (i *Index) Builder(table string) *sql.IndexBuilder + func (i *Index) DropBuilder(table string) *sql.DropIndexBuilder + type Indexes []*Index + type Migrate struct + func NewMigrate(d dialect.Driver, opts ...MigrateOption) (*Migrate, error) + func (m *Migrate) Create(ctx context.Context, tables ...*Table) error + type MigrateOption func(*Migrate) + func WithDropColumn(b bool) MigrateOption + func WithDropIndex(b bool) MigrateOption + func WithFixture(b bool) MigrateOption + func WithGlobalUniqueID(b bool) MigrateOption + type MySQL struct + type Postgres struct + type ReferenceOption string + const Cascade + const NoAction + const Restrict + const SetDefault + const SetNull + func (r ReferenceOption) ConstName() string + type SQLite struct + type Table struct + Columns []*Column + ForeignKeys []*ForeignKey + Indexes []*Index + Name string + PrimaryKey []*Column + func NewTable(name string) *Table + func (t *Table) AddColumn(c *Column) *Table + func (t *Table) AddForeignKey(fk *ForeignKey) *Table + func (t *Table) AddIndex(name string, unique bool, columns []string) *Table + func (t *Table) AddPrimary(c *Column) *Table + type WriteDriver struct + func (w *WriteDriver) Commit() error + func (w *WriteDriver) Exec(_ context.Context, query string, _, _ interface{}) error + func (w *WriteDriver) Rollback() error + func (w *WriteDriver) Tx(context.Context) (dialect.Tx, error)