A lightweight, framework-agnostic command-line tool for database schema migrations using plain SQL.
Dbmate is a lightweight, command-line database migration tool that uses plain SQL files to manage schema changes. It solves the problem of keeping database schemas consistent across multiple developers and production servers, especially in environments using different programming languages or frameworks. Unlike framework-specific migration tools, dbmate is entirely language-agnostic and relies on simple SQL scripts.
Developers and teams building database-backed applications in multiple languages (e.g., microservices architectures) who need a unified, simple migration tool. It's also suitable for solo developers who prefer SQL over DSL-based migration systems.
Developers choose dbmate for its extreme simplicity, framework independence, and avoidance of vendor lock-in. Its single-binary distribution, support for multiple databases, and automatic schema dumping make it a robust yet minimal alternative to heavier, language-specific migration libraries.
🚀 A lightweight, framework-agnostic database migration tool.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works with any programming language or framework via a standalone CLI, making it ideal for polyglot microservices, as highlighted in the README's emphasis on consistency across diverse tech stacks.
Uses standard SQL files for migrations, avoiding proprietary DSLs, which simplifies adoption for developers familiar with SQL and reduces lock-in, as stated in the 'Features' section.
Supports PostgreSQL, MySQL, SQLite, ClickHouse, BigQuery, and Spanner, providing flexibility for projects using different database systems, detailed in the 'Connecting to the Database' section.
Automatically generates a schema.sql file for easy Git diffs and quick database restoration, enhancing development workflow, as explained in the 'Exporting Schema File' section.
Easy to install and deploy as a self-contained executable, reducing setup complexity, with installation options for npm, Homebrew, Docker, and direct downloads listed in the 'Installation' section.
Rollbacks only support the most recent migration and require explicit down SQL; complex or partial rollbacks are not handled, which can be cumbersome for error recovery or iterative development.
Schema dumping relies on pg_dump, mysqldump, or sqlite3 being available in PATH, and failures can occur if these are missing, as noted in the 'Exporting Schema File' section where it silently skips dumps.
Lacks features for advanced scenarios like data migrations, conditional execution, or dependency tracking, making it less suitable for complex projects compared to more robust tools in the 'Alternatives' table.
For some databases like Spanner, features are restricted (e.g., no schema dumps, DDL must run without transactions), requiring extra configuration and care, as admitted in the README's Spanner section.