Database migration tool for SQL files and Go functions
open sourceMITfree
goose is a database migration tool and Go library. You manage a database schema with incremental SQL migration files, Go migration functions, or both; the goose CLI applies SQL migrations, and for Go migrations you build your own goose binary that registers your functions and runs them with your own database connection, inside a transaction if you want. It needs no config files and its package registers no SQL drivers itself. It's a fork of the original liamstask/goose, under the MIT licence.
Ways to install
Package managers
Problems it solves
- version my database schema changes alongside my Go code
- run a data migration that needs Go logic, not just SQL
- apply pending database migrations when my service deploys
Features
- SQL migration files
- migrations written as Go functions
- Go migrations run inside a transaction
- no config files
- timestamped or sequential versions
- usable as a Go library or a CLI
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what goose (database migrations) does.
- golang-migrate Database migrations as a CLI and Go library
- Liquibase Track, version, deploy and roll back database schema changes across 70+ databases
- Atlas Database schema as code: plan, lint, test and apply schema migrations, like Terraform for databases
- dbmate A lightweight, framework-agnostic database migration tool for plain SQL migrations
- Bytebase The standard for database governance
- Reshape An easy-to-use, zero-downtime schema migration tool for Postgres
