Goose: a database migration tool that handles both SQL and Go migrations

AI-generated summary of reporting by GitHub Opensource Projects. Read the original for the full story.

Why it matters

Go developers can manage database schema changes with one tool that supports both plain SQL and Go code, avoiding heavier ORMs entirely.

Read this as

Goose is a free, open-source tool originally built by Pressly that manages database migrations, the process of safely changing a database's structure over time. Its distinguishing feature is that you can write those changes either as plain SQL files or as Go programming functions, mixing both in the same project. A command like 'goose up' applies changes in order and 'goose down' reverses them, with a tracking table preventing double application. It affects developers building Go applications who don't want a full ORM.

Goose, a mature migration tool maintained by Pressly and now open source, matters for teams shipping Go services that need database schema version control without adopting an ORM. Its differentiators are mixed SQL/Go migrations and embeddable migration files in a single binary, cutting deploy-time file management. It supports PostgreSQL, MySQL and SQLite, and is free to install. Risk is low given its maturity; the article gives no adoption figures, benchmarks or pricing model details.

Goose supports migrations written as .sql files or Go functions with Up/Down methods, tracked in a goose_db_version table to prevent duplicate application. Because it compiles to a Go binary, migration files can be embedded via Go's embed mechanism, so deployments ship migrations inside the application executable. Go-based migrations can call external APIs or use the standard library for data transforms. Supported databases include PostgreSQL, MySQL and SQLite. No benchmark figures or performance limitations are given.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Goose Pressly Go PostgreSQL MySQL SQLite

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading