Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. sql-migrate

sql-migrate

MITGo

A SQL schema migration tool for Go that works as both a CLI and library, supporting multiple databases.

GitHubGitHub
3.4k stars292 forks0 contributors

What is sql-migrate?

sql-migrate is a SQL schema migration tool for Go that manages database schema changes through version-controlled SQL files. It solves the problem of evolving database schemas consistently across development, testing, and production environments. The tool supports both CLI usage and library integration, making it adaptable to various workflows.

Target Audience

Go developers and teams who need a reliable, SQL-based migration solution for applications using SQLite, PostgreSQL, MySQL, MSSQL, or Oracle databases.

Value Proposition

Developers choose sql-migrate for its dual CLI/library design, multi-database support, and atomic migration capabilities. Its SQL-first approach provides transparency and control, avoiding opaque abstraction layers while ensuring safe rollbacks and environment consistency.

Overview

SQL schema migration tool for Go.

Use Cases

Best For

  • Managing database schema changes in Go applications with version-controlled SQL files
  • Teams needing atomic migrations with up/down rollback support across multiple database types
  • Embedding migration files directly into Go binaries for self-contained deployments
  • Integrating migrations as a library within larger Go codebases
  • Automating schema updates in CI/CD pipelines via CLI tooling
  • Projects requiring non-transactional migrations for database-specific operations like concurrent indexing

Not Ideal For

  • Projects using NoSQL databases like MongoDB or Cassandra
  • Teams preferring ORM-integrated migrations such as GORM's auto-migrate
  • Environments requiring a graphical interface for migration management

Pros & Cons

Pros

Dual Usage Flexibility

Can be used as a standalone CLI tool or embedded as a Go library, adapting to various deployment and development workflows, as highlighted in the README's feature list.

Multi-Database Support

Supports SQLite, PostgreSQL, MySQL, MSSQL, and Oracle, covering most popular SQL databases through gorp integration, making it versatile for polyglot environments.

Atomic and Rollback Safe

Ensures migrations are applied atomically with up/down rollbacks, preventing partial updates and allowing safe reversals, a core feature emphasized in the documentation.

SQL-First Control

Uses plain SQL files for migrations, giving developers full control over schema changes without abstraction layers, aligning with the project's philosophy of simplicity.

Cons

Oracle Setup Complexity

Requires external Oracle Instant Client and environment variable configuration for Oracle support, adding significant setup overhead and potential dependency issues.

Manual SQL Authoring

Lacks auto-generation from Go structs or models; all migrations must be written as SQL files manually, which can be tedious for rapid iteration or large schema changes.

Configuration Overhead

Requires a YAML configuration file for different environments, which might be cumbersome for simple projects or when integrating into existing complex setups.

Frequently Asked Questions

Quick Stats

Stars3,419
Forks292
Contributors0
Open Issues72
Last commit1 month ago
CreatedSince 2014

Tags

#cli-tool#database-migrations#multi-database#schema-management#go#sql

Built With

G
Go

Included in

Go169.1k
Auto-fetched 8 hours ago

Related Projects

migratemigrate

Database migrations. CLI and Golang library.

Stars18,903
Forks1,607
Last commit15 hours ago
BytebaseBytebase

Database governance built for humans and agents — controlling changes and access across every major database.

Stars14,468
Forks983
Last commit9 hours ago
goosegoose

A database migration tool. Supports SQL migrations and Go functions.

Stars11,429
Forks695
Last commit3 days ago
AtlasAtlas

Declarative schema migrations with schema-as-code workflows

Stars8,709
Forks373
Last commit4 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub