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 (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 (c 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) Generate(ctx context.Context, db sqlx.DBExecutor) error
- func (c MysqlConnector) IsErrorConflict(err error) bool
- func (c MysqlConnector) IsErrorUnknownDatabase(err error) bool
- func (c *MysqlConnector) Migrate(ctx context.Context, db sqlx.DBExecutor) error
- func (c *MysqlConnector) ModifyColumn(col *builder.Column, prev *builder.Column) builder.SqlExpr
- func (MysqlConnector) PrimaryKeyName() string
- func (c *MysqlConnector) RenameColumn(col *builder.Column, target *builder.Column) builder.SqlExpr
- func (c *MysqlConnector) TruncateTable(t *builder.Table) builder.SqlExpr
- func (c MysqlConnector) WithDBName(dbName string) driver.Connector
- type SqlPrinter
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"` DATA_TYPE string `db:"DATA_TYPE"` COLUMN_TYPE string `db:"COLUMN_TYPE"` EXTRA string `db:"EXTRA"` IS_NULLABLE string `db:"IS_NULLABLE"` COLUMN_DEFAULT sql.NullString `db:"COLUMN_DEFAULT"` CHARACTER_MAXIMUM_LENGTH uint64 `db:"CHARACTER_MAXIMUM_LENGTH"` NUMERIC_PRECISION uint64 `db:"NUMERIC_PRECISION"` NUMERIC_SCALE uint64 `db:"NUMERIC_SCALE"` }
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"` SUB_PART string `db:"SUB_PART"` INDEX_TYPE string `db:"INDEX_TYPE"` }
func (IndexSchema) TableName ¶
func (IndexSchema) TableName() string
type MySqlLoggingDriver ¶
type MySqlLoggingDriver struct {
// contains filtered or unexported fields
}
func (*MySqlLoggingDriver) Driver ¶
func (d *MySqlLoggingDriver) Driver() driver.Driver
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) CreateDatabase ¶
func (c *MysqlConnector) CreateDatabase(dbName string) builder.SqlExpr
func (*MysqlConnector) CreateSchema ¶
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 (c 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) Generate ¶ added in v1.0.2
func (c *MysqlConnector) Generate(ctx context.Context, db sqlx.DBExecutor) error
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(ctx context.Context, db sqlx.DBExecutor) error
func (*MysqlConnector) ModifyColumn ¶
func (MysqlConnector) PrimaryKeyName ¶
func (MysqlConnector) PrimaryKeyName() string
func (*MysqlConnector) RenameColumn ¶
func (*MysqlConnector) TruncateTable ¶
func (c *MysqlConnector) TruncateTable(t *builder.Table) builder.SqlExpr
func (MysqlConnector) WithDBName ¶
func (c MysqlConnector) WithDBName(dbName string) driver.Connector
type SqlPrinter ¶
type SqlPrinter struct {
// contains filtered or unexported fields
}
func (*SqlPrinter) String ¶
func (p *SqlPrinter) String() string
Click to show internal directories.
Click to hide internal directories.