Documentation ¶
Index ¶
- func NewDriver(config dbmate.DriverConfig) dbmate.Driver
- type Driver
- func (drv *Driver) CreateDatabase() error
- func (drv *Driver) CreateMigrationsTable(db *sql.DB) error
- func (drv *Driver) DatabaseExists() (bool, error)
- func (drv *Driver) DeleteMigration(db dbutil.Transaction, version string) error
- func (drv *Driver) DropDatabase() error
- func (drv *Driver) DumpSchema(db *sql.DB) ([]byte, error)
- func (drv *Driver) InsertMigration(db dbutil.Transaction, version string) error
- func (drv *Driver) MigrationsTableExists(db *sql.DB) (bool, error)
- func (drv *Driver) Open() (*sql.DB, error)
- func (drv *Driver) Ping() error
- func (drv *Driver) SelectMigrations(db *sql.DB, limit int) (map[string]bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver provides top level database functions
func (*Driver) CreateDatabase ¶
CreateDatabase creates the specified database
func (*Driver) CreateMigrationsTable ¶
CreateMigrationsTable creates the schema migrations table
func (*Driver) DatabaseExists ¶
DatabaseExists determines whether the database exists
func (*Driver) DeleteMigration ¶
func (drv *Driver) DeleteMigration(db dbutil.Transaction, version string) error
DeleteMigration removes a migration record
func (*Driver) DropDatabase ¶
DropDatabase drops the specified database (if it exists)
func (*Driver) DumpSchema ¶
DumpSchema returns the current database schema
func (*Driver) InsertMigration ¶
func (drv *Driver) InsertMigration(db dbutil.Transaction, version string) error
InsertMigration adds a new migration record
func (*Driver) MigrationsTableExists ¶ added in v1.14.0
MigrationsTableExists checks if the schema_migrations table exists
Click to show internal directories.
Click to hide internal directories.