Changelog
Added
- Add support for
*sql.DB
-registered Go migrations (#450). Kudos to @cbodonnell for helping with this feature.
There are 2 new func types:
// GoMigration is a Go migration func that is run within a transaction.
type GoMigration func(tx *sql.Tx) error
// GoMigrationNoTx is a Go migration func that is run outside a transaction.
type GoMigrationNoTx func(db *sql.DB) error
And 2 new functions to register Go migrations:
// AddMigrationNoTx adds Go migrations that will be run outside transaction.
func AddMigrationNoTx(up, down GoMigrationNoTx) { ... }
// AddNamedMigrationNoTx adds named Go migrations that will be run outside transaction.
func AddNamedMigrationNoTx(filename string, up, down GoMigrationNoTx) { ... }
- Add
goose env
command to expose set environment variables (#443) - Add golangci-lint to enforce standards within the project (#456)
Fixed
- The SQL parser better handles leading/trailing empty lines and comments (#446). Additional tests have been added to capture edge cases with the parser.