mysql

package
v0.0.0-...-cb989e9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2025 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package mysql provides a MySQL implementation of the migrator.SchemaEditor interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Type__blob

func Type__blob(c *migrator.Column) string

func Type__bool

func Type__bool(c *migrator.Column) string

func Type__char

func Type__char(c *migrator.Column) string

func Type__datetime

func Type__datetime(c *migrator.Column) string

func Type__decimal

func Type__decimal(c *migrator.Column) string

func Type__float

func Type__float(c *migrator.Column) string

func Type__int

func Type__int(c *migrator.Column) string

func Type__string

func Type__string(c *migrator.Column) string

func Type__timestamp

func Type__timestamp(c *migrator.Column) string

func Type__ulid

func Type__ulid(c *migrator.Column) string

func Type__uuid

func Type__uuid(c *migrator.Column) string

func WriteColumn

func WriteColumn(w *strings.Builder, col migrator.Column)

Types

type MySQLSchemaEditor

type MySQLSchemaEditor struct {
	// contains filtered or unexported fields
}

func NewMySQLSchemaEditor

func NewMySQLSchemaEditor(db drivers.Database) *MySQLSchemaEditor

func (*MySQLSchemaEditor) AddField

func (m *MySQLSchemaEditor) AddField(ctx context.Context, table migrator.Table, col migrator.Column) error

func (*MySQLSchemaEditor) AddIndex

func (m *MySQLSchemaEditor) AddIndex(ctx context.Context, table migrator.Table, index migrator.Index, ifNotExists bool) error

func (*MySQLSchemaEditor) AlterField

func (m *MySQLSchemaEditor) AlterField(ctx context.Context, table migrator.Table, oldCol, newCol migrator.Column) error

func (*MySQLSchemaEditor) CreateTable

func (m *MySQLSchemaEditor) CreateTable(ctx context.Context, table migrator.Table, ifNotExists bool) error

func (*MySQLSchemaEditor) DropIndex

func (m *MySQLSchemaEditor) DropIndex(ctx context.Context, table migrator.Table, index migrator.Index, ifExists bool) error

func (*MySQLSchemaEditor) DropTable

func (m *MySQLSchemaEditor) DropTable(ctx context.Context, table migrator.Table, ifExists bool) error

func (*MySQLSchemaEditor) Execute

func (m *MySQLSchemaEditor) Execute(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*MySQLSchemaEditor) HasMigration

func (m *MySQLSchemaEditor) HasMigration(ctx context.Context, appName, modelName, migrationName string) (bool, error)

func (*MySQLSchemaEditor) RemoveField

func (m *MySQLSchemaEditor) RemoveField(ctx context.Context, table migrator.Table, col migrator.Column) error

func (*MySQLSchemaEditor) RemoveMigration

func (m *MySQLSchemaEditor) RemoveMigration(ctx context.Context, appName, modelName, migrationName string) error

func (*MySQLSchemaEditor) RenameIndex

func (m *MySQLSchemaEditor) RenameIndex(ctx context.Context, table migrator.Table, oldName, newName string) error

func (*MySQLSchemaEditor) RenameTable

func (m *MySQLSchemaEditor) RenameTable(ctx context.Context, table migrator.Table, newName string) error

func (*MySQLSchemaEditor) Setup

func (m *MySQLSchemaEditor) Setup(ctx context.Context) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL