Documentation ¶
Index ¶
- Variables
- func EnsureDBVersion(conf *DBConf, db *sql.DB) (int64, error)
- func GetDBVersion(conf *DBConf) (int64, error)
- func OpenDBFromDBConf(conf *DBConf) (*sql.DB, error)
- func RunMigrations(conf *DBConf, migrationsDir string, target int64) error
- func RunMigrationsOnDb(conf *DBConf, migrationsDir string, target int64, db *sql.DB) (err error)
- type DBConf
- type DBDriver
- type MySqlDialect
- type PostgresDialect
- type SqlDialect
- type Sqlite3Dialect
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTableDoesNotExist = errors.New("goosedb: table does not exist")
Functions ¶
func EnsureDBVersion ¶
EnsureDBVersion retrieves the current version for this DB, creating and initializing the DB version table if it doesn't exist.
func GetDBVersion ¶
wrapper for EnsureDBVersion for callers that don't already have their own DB instance
func OpenDBFromDBConf ¶
OpenDBFromDBConf wraps database/sql.DB.Open() and configures the newly opened DB based on the given DBConf.
Callers must Close() the returned DB.
Types ¶
type DBDriver ¶
type DBDriver struct { Name string OpenStr string Import string Dialect SqlDialect }
DBDriver encapsulates the info needed to work with a specific database driver
type MySqlDialect ¶
type MySqlDialect struct{}
type PostgresDialect ¶
type PostgresDialect struct{}
type SqlDialect ¶
type SqlDialect interface {
// contains filtered or unexported methods
}
SqlDialect abstracts the details of specific SQL dialects for goose's few SQL specific statements
type Sqlite3Dialect ¶
type Sqlite3Dialect struct{}
Click to show internal directories.
Click to hide internal directories.