package mysql

import "github.com/golang-migrate/migrate/v4/database/mysql"

Index

Variables

var (
	ErrDatabaseDirty    = fmt.Errorf("database is dirty")
	ErrNilConfig        = fmt.Errorf("no config")
	ErrNoDatabaseName   = fmt.Errorf("no database name")
	ErrAppendPEM        = fmt.Errorf("failed to append PEM")
	ErrTLSCertKeyConfig = fmt.Errorf("To use TLS client authentication, both x-tls-cert and x-tls-key must not be empty")
)
var DefaultMigrationsTable = "schema_migrations"

Functions

func WithInstance

func WithInstance(instance *sql.DB, config *Config) (database.Driver, error)

instance must have `multiStatements` set to true

Types

type Config

type Config struct {
	MigrationsTable string
	DatabaseName    string
	NoLock          bool
}

type Mysql

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

func WithConnection

func WithConnection(ctx context.Context, conn *sql.Conn, config *Config) (*Mysql, error)

connection instance must have `multiStatements` set to true

func (*Mysql) Close

func (m *Mysql) Close() error

func (*Mysql) Drop

func (m *Mysql) Drop() (err error)

func (*Mysql) Lock

func (m *Mysql) Lock() error

func (*Mysql) Open

func (m *Mysql) Open(url string) (database.Driver, error)

func (*Mysql) Run

func (m *Mysql) Run(migration io.Reader) error

func (*Mysql) SetVersion

func (m *Mysql) SetVersion(version int, dirty bool) error

func (*Mysql) Unlock

func (m *Mysql) Unlock() error

func (*Mysql) Version

func (m *Mysql) Version() (version int, dirty bool, err error)

Source Files

mysql.go

Version
v4.15.0-beta.1
Published
Jul 31, 2021
Platform
js/wasm
Imports
14 packages
Last checked
25 seconds ago

Tools for package owners.