driver

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2017 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MySQL

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

MySQL driver object.

func (*MySQL) Close

func (d *MySQL) Close() error

Close is the last function to be called. Close any open connection here.

func (*MySQL) Count

func (d *MySQL) Count(val uint64) int

Count counts number of row the given migration version.

func (*MySQL) Create

func (d *MySQL) Create() error

Create creates

func (*MySQL) Current

func (d *MySQL) Current() (uint64, error)

Current returns the current migration version.

func (*MySQL) Delete

func (d *MySQL) Delete(val uint64) error

Delete deletes the given migration version.

func (*MySQL) Drop

func (d *MySQL) Drop() error

Drop drops

func (*MySQL) Exec

func (d *MySQL) Exec(query string, args ...interface{}) (sql.Result, error)

Exec executes a query without returning any rows. The args are for any placeholder parameters in the query.

func (*MySQL) Ext

func (d *MySQL) Ext() string

Ext returns the sql file extension used by path. The extension is the suffix beginning at the final dot in the final element of path; it is empty if there is no dot.

func (*MySQL) Insert

func (d *MySQL) Insert(val uint64) error

Insert inserts the given migration version.

func (*MySQL) Migrate

func (d *MySQL) Migrate(m *core.Migration) error

Migrate applies migration file.

func (*MySQL) Open

func (d *MySQL) Open(dsn string) error

Open is the first function to be called. Check the dsn string and open and verify any connection that has to be made.

func (*MySQL) Transaction

func (d *MySQL) Transaction(fn func(*sql.Tx) error) error

Transaction starts a db transaction. The isolation level is dependent on the driver.

func (*MySQL) Version

func (d *MySQL) Version() core.Version

Version returns a version interface.

Jump to

Keyboard shortcuts

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