package mysql

Import Path
	gorm.io/driver/mysql (on go.dev)

Dependency Relation
	imports 16 packages, and imported by one package


Package-Level Type Names (total 4)
/* sort by: | */
Config *Config Config.Conn gorm.ConnPool Config.DSN string Config.DSNConfig *mysql.Config Config.DefaultDatetimePrecision *int Config.DefaultStringSize uint Config.DisableDatetimePrecision bool Config.DisableWithReturning bool Config.DontSupportForShareClause bool Config.DontSupportNullAsDefaultValue bool Config.DontSupportRenameColumn bool Config.DontSupportRenameColumnUnique bool Config.DontSupportRenameIndex bool Config.DriverName string Config.ServerVersion string Config.SkipInitializeWithVersion bool ( Dialector) Apply(config *gorm.Config) error ( Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{}) ( Dialector) ClauseBuilders() map[string]clause.ClauseBuilder ( Dialector) DataTypeOf(field *schema.Field) string ( Dialector) DefaultValueOf(field *schema.Field) clause.Expression ( Dialector) Explain(sql string, vars ...interface{}) string ( Dialector) Initialize(db *gorm.DB) (err error) ( Dialector) Migrator(db *gorm.DB) gorm.Migrator ( Dialector) Name() string NowFunc return now func ( Dialector) QuoteTo(writer clause.Writer, str string) ( Dialector) RollbackTo(tx *gorm.DB, name string) error ( Dialector) SavePoint(tx *gorm.DB, name string) error ( Dialector) Translate(err error) error Dialector : gorm.io/gorm.Dialector Dialector : gorm.io/gorm.ErrorTranslator Dialector : gorm.io/gorm.Plugin Dialector : gorm.io/gorm.SavePointerDialectorInterface
Index table index info ColumnName string IndexName string NonUnique int32 TableName string
Dialector Dialector Dialector.Config.Conn gorm.ConnPool Dialector.Config.DSN string Dialector.Config.DSNConfig *mysql.Config Dialector.Config.DefaultDatetimePrecision *int Dialector.Config.DefaultStringSize uint Dialector.Config.DisableDatetimePrecision bool Dialector.Config.DisableWithReturning bool Dialector.Config.DontSupportForShareClause bool Dialector.Config.DontSupportNullAsDefaultValue bool Dialector.Config.DontSupportRenameColumn bool Dialector.Config.DontSupportRenameColumnUnique bool Dialector.Config.DontSupportRenameIndex bool Dialector.Config.DriverName string Dialector.Config.ServerVersion string Dialector.Config.SkipInitializeWithVersion bool Migrator migrator.Migrator Migrator.Config.CreateIndexAfterCreateTable bool Migrator.Config.DB *gorm.DB ( Migrator) AddColumn(value interface{}, name string) error ( Migrator) AlterColumn(value interface{}, field string) error ( Migrator) Apply(config *gorm.Config) error AutoMigrate auto migrate values ( Migrator) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{}) BuildIndexOptions build index options ( Migrator) ClauseBuilders() map[string]clause.ClauseBuilder ColumnTypes column types return columnTypes,error CreateConstraint create constraint CreateIndex create index `name` CreateTable create table in database for values CreateView create view from Query in gorm.ViewOption. Query in gorm.ViewOption is a [subquery] // CREATE VIEW `user_view` AS SELECT * FROM `users` WHERE age > 20 q := DB.Model(&User{}).Where("age > ?", 20) DB.Debug().Migrator().CreateView("user_view", gorm.ViewOption{Query: q}) // CREATE OR REPLACE VIEW `users_view` AS SELECT * FROM `users` WITH CHECK OPTION q := DB.Model(&User{}) DB.Debug().Migrator().CreateView("user_view", gorm.ViewOption{Query: q, Replace: true, CheckOption: "WITH CHECK OPTION"}) [subquery]: https://gorm.io/docs/advanced_query.html#SubQuery ( Migrator) CurrentDatabase() (name string) ( Migrator) CurrentSchema(stmt *gorm.Statement, table string) (string, string) CurrentTable returns current statement's table expression ( Migrator) DefaultValueOf(field *schema.Field) clause.Expression DropColumn drop value's `name` column ( Migrator) DropConstraint(value interface{}, name string) error DropIndex drop index `name` ( Migrator) DropTable(values ...interface{}) error DropView drop view ( Migrator) Explain(sql string, vars ...interface{}) string ( Migrator) FullDataTypeOf(field *schema.Field) clause.Expr ( Migrator) GetIndexes(value interface{}) ([]gorm.Index, error) ( Migrator) GetTables() (tableList []string, err error) ( Migrator) GetTypeAliases(databaseTypeName string) []string GuessConstraintAndTable guess statement's constraint and it's table based on name HasColumn check has column `field` for value or not HasConstraint check has constraint or not HasIndex check has index `name` or not HasTable returns table exists or not for value, value could be a struct or string ( Migrator) Initialize(db *gorm.DB) (err error) MigrateColumn migrate column ( Migrator) Name() string NowFunc return now func ( Migrator) QuoteTo(writer clause.Writer, str string) ( Migrator) RenameColumn(value interface{}, oldName, newName string) error ( Migrator) RenameIndex(value interface{}, oldName, newName string) error RenameTable rename table from oldName to newName ReorderModels reorder models according to constraint dependencies ( Migrator) RollbackTo(tx *gorm.DB, name string) error RunWithValue run migration with statement value ( Migrator) SavePoint(tx *gorm.DB, name string) error TableType table type return tableType,error ( Migrator) TiDBVersion() (isTiDB bool, major, minor, patch int, err error) ( Migrator) Translate(err error) error Migrator : gorm.io/gorm.ErrorTranslator Migrator : gorm.io/gorm.Migrator Migrator : gorm.io/gorm.Plugin Migrator : gorm.io/gorm.SavePointerDialectorInterface Migrator : gorm.io/gorm/migrator.BuildIndexOptionsInterface
Package-Level Functions (total 2)
func New(config Config) gorm.Dialector
Package-Level Variables (total 4)
CreateClauses create clauses
DeleteClauses delete clauses
QueryClauses query clauses
UpdateClauses update clauses
Package-Level Constants (total 4)
const AutoRandomTag = "auto_random()" // Treated as an auto_random field for tidb
ClauseFor for clause.ClauseBuilder FOR key
ClauseOnConflict for clause.ClauseBuilder ON CONFLICT key
ClauseValues for clause.ClauseBuilder VALUES key