Documentation
¶
Index ¶
- Variables
- type ColumnSchema
- type IndexSchema
- type MySqlLoggingDriver
- type MysqlConnector
- func (c *MysqlConnector) AddColumn(col *builder.Column) builder.SqlExpr
- func (c *MysqlConnector) AddIndex(key *builder.Key) builder.SqlExpr
- func (MysqlConnector) BindVar(i int) string
- func (c *MysqlConnector) Connect(ctx context.Context) (driver.Conn, error)
- func (c *MysqlConnector) CreateDatabase(dbName string) builder.SqlExpr
- func (c *MysqlConnector) CreateSchema(schema string) builder.SqlExpr
- func (c *MysqlConnector) CreateTableIsNotExists(table *builder.Table) (exprs []builder.SqlExpr)
- func (c *MysqlConnector) DataType(columnType *builder.ColumnType) builder.SqlExpr
- func (MysqlConnector) Driver() driver.Driver
- func (MysqlConnector) DriverName() string
- func (c *MysqlConnector) DropColumn(col *builder.Column) builder.SqlExpr
- func (c *MysqlConnector) DropDatabase(dbName string) builder.SqlExpr
- func (c *MysqlConnector) DropIndex(key *builder.Key) builder.SqlExpr
- func (c *MysqlConnector) DropTable(t *builder.Table) builder.SqlExpr
- func (c MysqlConnector) IsErrorConflict(err error) bool
- func (c MysqlConnector) IsErrorUnknownDatabase(err error) bool
- func (c *MysqlConnector) Migrate(db *sqlx.DB, opts *migration.MigrationOpts) error
- func (c *MysqlConnector) ModifyColumn(col *builder.Column) builder.SqlExpr
- func (MysqlConnector) PrimaryKeyName() string
- func (c *MysqlConnector) TruncateTable(t *builder.Table) builder.SqlExpr
- func (c MysqlConnector) WithDBName(dbName string) driver.Connector
Constants ¶
This section is empty.
Variables ¶
View Source
var DuplicateEntryErrNumber uint16 = 1062
View Source
var SchemaDatabase = sqlx.NewDatabase("INFORMATION_SCHEMA")
Functions ¶
This section is empty.
Types ¶
type ColumnSchema ¶
type ColumnSchema struct {
TABLE_SCHEMA string `db:"TABLE_SCHEMA"`
TABLE_NAME string `db:"TABLE_NAME"`
COLUMN_NAME string `db:"COLUMN_NAME"`
}
func (ColumnSchema) TableName ¶
func (ColumnSchema) TableName() string
type IndexSchema ¶
type IndexSchema struct {
TABLE_SCHEMA string `db:"TABLE_SCHEMA"`
TABLE_NAME string `db:"TABLE_NAME"`
NON_UNIQUE int32 `db:"NON_UNIQUE"`
INDEX_NAME string `db:"INDEX_NAME"`
SEQ_IN_INDEX int32 `db:"SEQ_IN_INDEX"`
COLUMN_NAME string `db:"COLUMN_NAME"`
INDEX_TYPE string `db:"INDEX_TYPE"`
}
func (IndexSchema) TableName ¶
func (IndexSchema) TableName() string
type MySqlLoggingDriver ¶
type MySqlLoggingDriver struct {
Logger *logrus.Logger
Driver *mysql.MySQLDriver
}
type MysqlConnector ¶
func (*MysqlConnector) AddColumn ¶
func (c *MysqlConnector) AddColumn(col *builder.Column) builder.SqlExpr
func (*MysqlConnector) AddIndex ¶
func (c *MysqlConnector) AddIndex(key *builder.Key) builder.SqlExpr
func (MysqlConnector) BindVar ¶
func (MysqlConnector) BindVar(i int) string
func (*MysqlConnector) CreateDatabase ¶
func (c *MysqlConnector) CreateDatabase(dbName string) builder.SqlExpr
func (*MysqlConnector) CreateSchema ¶ added in v2.2.2
func (c *MysqlConnector) CreateSchema(schema string) builder.SqlExpr
func (*MysqlConnector) CreateTableIsNotExists ¶
func (c *MysqlConnector) CreateTableIsNotExists(table *builder.Table) (exprs []builder.SqlExpr)
func (*MysqlConnector) DataType ¶
func (c *MysqlConnector) DataType(columnType *builder.ColumnType) builder.SqlExpr
func (MysqlConnector) Driver ¶
func (MysqlConnector) Driver() driver.Driver
func (MysqlConnector) DriverName ¶
func (MysqlConnector) DriverName() string
func (*MysqlConnector) DropColumn ¶
func (c *MysqlConnector) DropColumn(col *builder.Column) builder.SqlExpr
func (*MysqlConnector) DropDatabase ¶
func (c *MysqlConnector) DropDatabase(dbName string) builder.SqlExpr
func (*MysqlConnector) DropIndex ¶
func (c *MysqlConnector) DropIndex(key *builder.Key) builder.SqlExpr
func (*MysqlConnector) DropTable ¶
func (c *MysqlConnector) DropTable(t *builder.Table) builder.SqlExpr
func (MysqlConnector) IsErrorConflict ¶
func (c MysqlConnector) IsErrorConflict(err error) bool
func (MysqlConnector) IsErrorUnknownDatabase ¶
func (c MysqlConnector) IsErrorUnknownDatabase(err error) bool
func (*MysqlConnector) Migrate ¶
func (c *MysqlConnector) Migrate(db *sqlx.DB, opts *migration.MigrationOpts) error
func (*MysqlConnector) ModifyColumn ¶
func (c *MysqlConnector) ModifyColumn(col *builder.Column) builder.SqlExpr
func (MysqlConnector) PrimaryKeyName ¶
func (MysqlConnector) PrimaryKeyName() string
func (*MysqlConnector) TruncateTable ¶
func (c *MysqlConnector) TruncateTable(t *builder.Table) builder.SqlExpr
func (MysqlConnector) WithDBName ¶
func (c MysqlConnector) WithDBName(dbName string) driver.Connector
Click to show internal directories.
Click to hide internal directories.