Versions in this module Expand all Collapse all v1 v1.24.5 Feb 22, 2023 Changes in this version + type BuildIndexOptionsInterface interface + BuildIndexOptions func([]schema.IndexOption, *gorm.Statement) []interface{} + type ColumnType struct + AutoIncrementValue sql.NullBool + ColumnTypeValue sql.NullString + CommentValue sql.NullString + DataTypeValue sql.NullString + DecimalSizeValue sql.NullInt64 + DefaultValueValue sql.NullString + LengthValue sql.NullInt64 + NameValue sql.NullString + NullableValue sql.NullBool + PrimaryKeyValue sql.NullBool + SQLColumnType *sql.ColumnType + ScaleValue sql.NullInt64 + ScanTypeValue reflect.Type + UniqueValue sql.NullBool + func (ct ColumnType) AutoIncrement() (isAutoIncrement bool, ok bool) + func (ct ColumnType) ColumnType() (columnType string, ok bool) + func (ct ColumnType) Comment() (value string, ok bool) + func (ct ColumnType) DatabaseTypeName() string + func (ct ColumnType) DecimalSize() (precision int64, scale int64, ok bool) + func (ct ColumnType) DefaultValue() (value string, ok bool) + func (ct ColumnType) Length() (length int64, ok bool) + func (ct ColumnType) Name() string + func (ct ColumnType) Nullable() (nullable bool, ok bool) + func (ct ColumnType) PrimaryKey() (isPrimaryKey bool, ok bool) + func (ct ColumnType) ScanType() reflect.Type + func (ct ColumnType) Unique() (unique bool, ok bool) + type Config struct + CreateIndexAfterCreateTable bool + DB *gorm.DB + type GormDataTypeInterface interface + GormDBDataType func(*gorm.DB, *schema.Field) string + type Index struct + ColumnList []string + NameValue string + OptionValue string + PrimaryKeyValue sql.NullBool + TableName string + UniqueValue sql.NullBool + func (idx Index) Columns() []string + func (idx Index) Name() string + func (idx Index) Option() string + func (idx Index) PrimaryKey() (isPrimaryKey bool, ok bool) + func (idx Index) Table() string + func (idx Index) Unique() (unique bool, ok bool) + type Migrator struct + func (m Migrator) AddColumn(value interface{}, name string) error + func (m Migrator) AlterColumn(value interface{}, field string) error + func (m Migrator) AutoMigrate(values ...interface{}) error + func (m Migrator) BuildIndexOptions(opts []schema.IndexOption, stmt *gorm.Statement) (results []interface{}) + func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error) + func (m Migrator) CreateConstraint(value interface{}, name string) error + func (m Migrator) CreateIndex(value interface{}, name string) error + func (m Migrator) CreateTable(values ...interface{}) error + func (m Migrator) CreateView(name string, option gorm.ViewOption) error + func (m Migrator) CurrentDatabase() (name string) + func (m Migrator) CurrentTable(stmt *gorm.Statement) interface{} + func (m Migrator) DataTypeOf(field *schema.Field) string + func (m Migrator) DropColumn(value interface{}, name string) error + func (m Migrator) DropConstraint(value interface{}, name string) error + func (m Migrator) DropIndex(value interface{}, name string) error + func (m Migrator) DropTable(values ...interface{}) error + func (m Migrator) DropView(name string) error + func (m Migrator) FullDataTypeOf(field *schema.Field) (expr clause.Expr) + func (m Migrator) GetIndexes(dst interface{}) ([]gorm.Index, error) + func (m Migrator) GetTables() (tableList []string, err error) + func (m Migrator) GetTypeAliases(databaseTypeName string) []string + func (m Migrator) GuessConstraintAndTable(stmt *gorm.Statement, name string) (_ *schema.Constraint, _ *schema.Check, table string) + func (m Migrator) HasColumn(value interface{}, field string) bool + func (m Migrator) HasConstraint(value interface{}, name string) bool + func (m Migrator) HasIndex(value interface{}, name string) bool + func (m Migrator) HasTable(value interface{}) bool + func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnType gorm.ColumnType) error + func (m Migrator) RenameColumn(value interface{}, oldName, newName string) error + func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error + func (m Migrator) RenameTable(oldName, newName interface{}) error + func (m Migrator) ReorderModels(values []interface{}, autoAdd bool) (results []interface{}) + func (m Migrator) RunWithValue(value interface{}, fc func(*gorm.Statement) error) error