Favicon of goose

goose

Command-line database migration tool supporting PostgreSQL, MySQL, SQLite, and 8+ other databases. Create and manage schema changes through incremental SQL scripts with zero configuration required.

Goose is a straightforward database migration tool that handles schema changes through incremental SQL scripts executed from the terminal. It works as both a CLI tool and a library, making it flexible for different development workflows.

Key capabilities include:

  • Multi-database support: Works with PostgreSQL, MySQL, SQLite, ClickHouse, MSSQL, Vertica, DuckDB, TiDB, Spanner, YDB, and more
  • Flexible migration creation: Write migrations as SQL files or Go functions
  • Zero configuration: No config files needed—just specify your database and run commands
  • Out-of-order migrations: Apply migrations in any order when needed
  • Embedded migrations: Support for Go's embed package for bundled migrations
  • Data seeding: Populate databases with initial data during migrations
  • Environment variable substitution: Use variables directly in SQL migration files
  • Sequential or timestamp naming: Choose between sequential numbering or timestamp-based file names

Common operations include creating new migrations, applying pending changes, rolling back to specific versions, checking migration status, and validating migration files before execution. The tool is particularly well-suited for Go projects but works effectively with SQL files across any language or database system.

Install

Go
$ go install github.com/pressly/goose/v3/cmd/goose@latest

Features

JSON outputScriptable

Media

Pros

4
  • Supports over 10 different databases including PostgreSQL, MySQL, and SQLite.
  • Can manage database schema using SQL scripts or Go functions.
  • Supports embedded migrations and out-of-order migrations.
  • Environment variable substitution in SQL migrations.

Related tools

Categories:

Share:

Auto-fetched .

Recent releases

Similar to goose

Favicon

 

  
 
Favicon

 

  
 
Favicon