Documentation ¶
Overview ¶
Package driver holds the driver interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Drivers ¶ added in v1.3.0
func Drivers() []string
Drivers returns a sorted list of the names of the registered drivers.
func FilenameExtensionFromURL ¶ added in v1.3.1
FilenameExtensionFromURL return extension for migration files. Used for create migrations
func RegisterDriver ¶ added in v1.3.0
RegisterDriver register a driver so it can be created from its name. Drivers should call this from an init() function so that they registers themselves on import
Types ¶
type Driver ¶
type Driver interface { // Initialize is the first function to be called. // Check the url string and open and verify any connection // that has to be made. Initialize(url string) error // Close is the last function to be called. // Close any open connection here. Close() error // FilenameExtension returns the extension of the migration files. // The returned string must not begin with a dot. FilenameExtension() string // Migrate is the heart of the driver. // It will receive a file which the driver should apply // to its backend or whatever. The migration function should use // the pipe channel to return any errors or other useful information. Migrate(file file.File, pipe chan interface{}) // Version returns the current migration version. Version() (uint64, error) }
Driver is the interface type that needs to implemented by all drivers.
Directories ¶
Path | Synopsis |
---|---|
Package bash implements the Driver interface.
|
Package bash implements the Driver interface. |
Package cassandra implements the Driver interface.
|
Package cassandra implements the Driver interface. |
Package crate implements a driver for the Crate.io database
|
Package crate implements a driver for the Crate.io database |
Package mssql implements the Driver interface.
|
Package mssql implements the Driver interface. |
Package mysql implements the Driver interface.
|
Package mysql implements the Driver interface. |
Package neo4j implements the Driver interface.
|
Package neo4j implements the Driver interface. |
Package postgres implements the Driver interface.
|
Package postgres implements the Driver interface. |
Package sqlite3 implements the Driver interface.
|
Package sqlite3 implements the Driver interface. |
Click to show internal directories.
Click to hide internal directories.