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) QueryError(query string, err error) 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 ¶
MigrationsTableExists checks if the schema_migrations table exists
func (*Driver) Ping ¶
Ping verifies a connection to the database server. It does not verify whether the specified database exists.
func (*Driver) QueryError ¶ added in v2.8.0
Return a normalized version of the driver-specific error type.
Click to show internal directories.
Click to hide internal directories.