migrate is a Golang application and library to apply migrations based on .sql files.
The dabase/sql interface doesn't hand itself nicely to this, as it doesn't support bulk transactions and support to send multiple language commands per query depends on the driver.
To avoid forcing more dependencies than absolutely required these implementations should be placed in separate packages - e.g. cgo in cgo/migrate and go in go/migrate. Consumers can then explicitly import these packages.
migrate is a Golang application and library to apply migrations based on
.sql
files. Thedabase/sql
interface doesn't hand itself nicely to this, as it doesn't support bulk transactions and support to send multiple language commands per query depends on the driver.To add support the
driver
interface from migrate must be implemented: https://github.com/golang-migrate/migrate/blob/master/database/driver.go The library works similar todatabase/sql/driver
- a valid driver must register itself.To avoid forcing more dependencies than absolutely required these implementations should be placed in separate packages - e.g. cgo in
cgo/migrate
and go ingo/migrate
. Consumers can then explicitly import these packages.