Documentation
¶
Overview ¶
Package mysql provides a MySQL implementation of the migrator.SchemaEditor interface.
Index ¶
- func Type__blob(c *migrator.Column) string
- func Type__bool(c *migrator.Column) string
- func Type__char(c *migrator.Column) string
- func Type__datetime(c *migrator.Column) string
- func Type__decimal(c *migrator.Column) string
- func Type__float(c *migrator.Column) string
- func Type__int(c *migrator.Column) string
- func Type__string(c *migrator.Column) string
- func Type__timestamp(c *migrator.Column) string
- func Type__ulid(c *migrator.Column) string
- func Type__uuid(c *migrator.Column) string
- func WriteColumn(w *strings.Builder, col migrator.Column)
- type MySQLSchemaEditor
- func (m *MySQLSchemaEditor) AddField(ctx context.Context, table migrator.Table, col migrator.Column) error
- func (m *MySQLSchemaEditor) AddIndex(ctx context.Context, table migrator.Table, index migrator.Index, ...) error
- func (m *MySQLSchemaEditor) AlterField(ctx context.Context, table migrator.Table, oldCol, newCol migrator.Column) error
- func (m *MySQLSchemaEditor) CreateTable(ctx context.Context, table migrator.Table, ifNotExists bool) error
- func (m *MySQLSchemaEditor) DropIndex(ctx context.Context, table migrator.Table, index migrator.Index, ifExists bool) error
- func (m *MySQLSchemaEditor) DropTable(ctx context.Context, table migrator.Table, ifExists bool) error
- func (m *MySQLSchemaEditor) Execute(ctx context.Context, query string, args ...any) (sql.Result, error)
- func (m *MySQLSchemaEditor) HasMigration(ctx context.Context, appName, modelName, migrationName string) (bool, error)
- func (m *MySQLSchemaEditor) RemoveField(ctx context.Context, table migrator.Table, col migrator.Column) error
- func (m *MySQLSchemaEditor) RemoveMigration(ctx context.Context, appName, modelName, migrationName string) error
- func (m *MySQLSchemaEditor) RenameIndex(ctx context.Context, table migrator.Table, oldName, newName string) error
- func (m *MySQLSchemaEditor) RenameTable(ctx context.Context, table migrator.Table, newName string) error
- func (m *MySQLSchemaEditor) Setup(ctx context.Context) error
- func (m *MySQLSchemaEditor) StartTransaction(ctx context.Context) (drivers.Transaction, error)
- func (m *MySQLSchemaEditor) StoreMigration(ctx context.Context, appName, modelName, migrationName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Type__blob ¶
func Type__bool ¶
func Type__char ¶
func Type__datetime ¶
func Type__decimal ¶
func Type__float ¶
func Type__string ¶
func Type__timestamp ¶
func Type__ulid ¶
func Type__uuid ¶
Types ¶
type MySQLSchemaEditor ¶
type MySQLSchemaEditor struct {
// contains filtered or unexported fields
}
func NewMySQLSchemaEditor ¶
func NewMySQLSchemaEditor(db drivers.Database) *MySQLSchemaEditor
func (*MySQLSchemaEditor) AlterField ¶
func (*MySQLSchemaEditor) CreateTable ¶
func (*MySQLSchemaEditor) HasMigration ¶
func (*MySQLSchemaEditor) RemoveField ¶
func (*MySQLSchemaEditor) RemoveMigration ¶
func (m *MySQLSchemaEditor) RemoveMigration(ctx context.Context, appName, modelName, migrationName string) error
func (*MySQLSchemaEditor) RenameIndex ¶
func (*MySQLSchemaEditor) RenameTable ¶
func (*MySQLSchemaEditor) StartTransaction ¶
func (m *MySQLSchemaEditor) StartTransaction(ctx context.Context) (drivers.Transaction, error)
func (*MySQLSchemaEditor) StoreMigration ¶
func (m *MySQLSchemaEditor) StoreMigration(ctx context.Context, appName, modelName, migrationName string) error
Click to show internal directories.
Click to hide internal directories.