goose (Go migrations)
Database migration tool for Go. Manages SQL schema migrations with versioned migration files. Supports SQL migrations (plain .sql files) and Go migrations (code-based for data migrations). CLI tool and Go library API. Works with PostgreSQL, MySQL, SQLite, CockroachDB. Used by popular Go projects including Temporal and Litestream.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Migration files may contain schema secrets — store in version control but ensure DB credentials in connection strings are not committed.
⚡ Reliability
Best When
Go projects that need simple, file-based database migrations with rollback support.
Avoid When
Non-Go projects or when schema-first ORM approaches (ent, GORM AutoMigrate) are preferred.
Use Cases
- • Manage PostgreSQL/MySQL schema migrations in Go projects with versioned .sql files and up/down rollback
- • Embed goose migrations in Go binaries using embed.FS for self-contained deployment without external migration files
- • Run data migrations alongside schema migrations with Go-based migration functions for complex transformations
- • Integrate goose into CI/CD pipelines for automatic schema migration on deploy
- • Use as a library in Go services: goose.Up(db, migrationsDir) for programmatic migration execution
Not For
- • Non-Go projects — use Flyway, Liquibase, or Alembic for language-agnostic migration management
- • Schema generation from code — goose is migration-focused; use ent or sqlc for schema-first development
- • Distributed multi-region migrations — goose is single-region; coordinate migrations separately in multi-region deployments
Interface
Authentication
CLI/library tool — auth via database connection string.
Pricing
MIT licensed open source tool.
Agent Metadata
Known Gotchas
- ⚠ Migration files must follow naming convention: YYYYMMDDHHMMSS_description.sql — wrong format causes migrations to be skipped silently
- ⚠ goose v3.x changed the Go API — code using older v2 goose will need updates; always check which version you're importing
- ⚠ No-transaction migrations require -- +goose NO TRANSACTION annotation — DDL that can't run in a transaction (PostgreSQL CONCURRENTLY index creation) needs this
- ⚠ Down migrations are optional — if no Down section is provided, rollback (goose down) fails with an error
- ⚠ SQL dialect differences matter — goose SQL migrations are passed directly to the database; PostgreSQL $ placeholders differ from MySQL ?
- ⚠ Embedding migrations with embed.FS requires importing goose/v3/embed package — the embedding API changed in v3
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for goose (Go migrations).
Scores are editorial opinions as of 2026-03-06.