Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoDB set to Options ErrNoDB = fmt.Errorf("no db") // ErrDirNotExists when migration path not exists ErrDirNotExists = fmt.Errorf("migrations dir not exists") // ErrBothMigrateTypes when up or down migration file not found ErrBothMigrateTypes = errors.New("migration must have up and down files") // ErrPositiveSteps when steps < 0 ErrPositiveSteps = errors.New("steps must be a positive number") )
Functions ¶
Types ¶
type DB ¶
type DB interface { RunInTransaction(fn func(*pg.Tx) error) error Exec(query interface{}, params ...interface{}) (orm.Result, error) ExecOne(query interface{}, params ...interface{}) (orm.Result, error) Query(model, query interface{}, params ...interface{}) (orm.Result, error) QueryOne(model, query interface{}, params ...interface{}) (orm.Result, error) }
DB interface
type Logger ¶
type Logger interface {
Infof(format string, args ...interface{})
}
Logger interface for migrator
type Migration ¶
type Migration struct { Version int64 Name string CreatedAt time.Time Up func(DB) error Down func(DB) error }
Migration item
Click to show internal directories.
Click to hide internal directories.