Documentation ¶
Index ¶
- type Mysql
- func (m *Mysql) Close() error
- func (m *Mysql) CreateVersionTableIfNotExists() error
- func (m *Mysql) DeleteVersion(version uint64) error
- func (m *Mysql) Exec(query string) error
- func (m *Mysql) GetAppliedTimeList() (map[uint64]time.Time, error)
- func (m *Mysql) GetCurrentVersion() (uint64, error)
- func (m *Mysql) Open(dsn string) error
- func (m *Mysql) SetVersion(version uint64) error
- func (m *Mysql) Transaction(fn func() error) error
- type Row
- type TDriver
- func (td *TDriver) Close() error
- func (td *TDriver) CreateVersionTableIfNotExists() error
- func (td *TDriver) DeleteVersion(version uint64) error
- func (td *TDriver) Exec(query string) error
- func (td *TDriver) GetAppliedTimeList() (map[uint64]time.Time, error)
- func (td *TDriver) GetCurrentVersion() (uint64, error)
- func (td *TDriver) Open(dsn string) error
- func (td *TDriver) SetVersion(version uint64) error
- func (td *TDriver) Transaction(fn func() error) error
- func (td *TDriver) Versions() []uint64
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 is one of driver impls.
func (*Mysql) CreateVersionTableIfNotExists ¶
CreateVersionTableIfNotExists creates schema version table if table does not exist.
func (*Mysql) DeleteVersion ¶
DeleteVersion deletes version column from database.
func (*Mysql) GetAppliedTimeList ¶ added in v1.0.0
GetAppliedTimeList returns list of migration applied times.
func (*Mysql) GetCurrentVersion ¶
GetCurrentVersion returns current migration version of database.
func (*Mysql) SetVersion ¶
SetVersion appends new version.
func (*Mysql) Transaction ¶
Transaction executes a function atomically. Roll back the process if function returns error.
type TDriver ¶
type TDriver struct { CountOfExec int Rows []*Row Created bool JustCreated bool // contains filtered or unexported fields }
TDriver is driver impl for test. Don't use expect in test.
func (*TDriver) CreateVersionTableIfNotExists ¶
CreateVersionTableIfNotExists ...
func (*TDriver) DeleteVersion ¶
DeleteVersion ...
func (*TDriver) GetAppliedTimeList ¶ added in v1.0.0
GetAppliedTimeList returns list of migration applied times.
func (*TDriver) GetCurrentVersion ¶
GetCurrentVersion ...
Click to show internal directories.
Click to hide internal directories.