talira

goose (database migrations)

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

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 toolplan not known

Alternatives

The same job

These do what goose (database migrations) does.

  1. golang-migrate Database migrations as a CLI and Go library
  2. Liquibase Track, version, deploy and roll back database schema changes across 70+ databases
  3. Atlas Database schema as code: plan, lint, test and apply schema migrations, like Terraform for databases
  4. dbmate A lightweight, framework-agnostic database migration tool for plain SQL migrations
  5. Bytebase The standard for database governance
  6. Reshape An easy-to-use, zero-downtime schema migration tool for Postgres

Compare goose (database migrations) with the top 3