Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterDialect ¶
RegisterDialect register new dialect
Types ¶
type Dialect ¶
type Dialect interface { // Name get dialect's name Name() string // SetDB set db for dialect SetDB(db db.Store) // DB gets dialect db DB() db.Store // HasTable check has table or not HasTable(tableName string) bool // CurrentDatabase return current database name CurrentDatabase() string // MigrationExists checks if migration version exists in database table MigrationExists(version string, tableName string) (bool, error) // CreateMigrationTable creates migrations table in database CreateMigrationTable(tableName string) error // CountRecords retunrs number of rows in provided table CountRecords(tableName string) (int, error) // SaveMigration stores migration version and name in database SaveMigration(tableName string, version string, name string) error // RemoveMigration deletes migration version from database table RemoveMigration(tableName string, version string) error }
Dialect defines set of methods needed by migrator to interact with different database engines
It contains behaviors that differ across SQL database
Click to show internal directories.
Click to hide internal directories.