mysql

package
Version: v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
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
}

type Mysql

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

func (*Mysql) Close

func (m *Mysql) Close() error

func (*Mysql) Drop

func (m *Mysql) Drop() 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL