dbdiff
rekurt.github.io
- Free plan
- Windows
- macOS
- Linux
- Self-hosted
What dbdiff is
DBDiff compares local or remote MySQL, PostgreSQL, and SQLite databases and generates migration files from differences in schema or data. Generated SQL migrations can include both up and down changes. Comparison targets include tables, views, triggers, routines, types, sequences, row-level security policies, and data. Output options include native SQL, Flyway, Liquibase, Laravel Migrations, and custom templates. A migration runner provides commands to create, apply, roll back, check, validate, repair, and baseline migrations. Configuration can set database connections and drivers, comparison scope, included or ignored tables and fields, and row filters. Install options include pre-built binaries for Windows, macOS, and Linux, as well as npm packages, a PHAR, Docker or Podman images, and Composer source installation. PostgreSQL support includes comparison of row-level security policies and table security flags. By default, generation stops if a migration would drop a table or column, though an option allows those changes. DBDiff is free, open source, and released under the MIT license. The project documents a PostgreSQL enum limitation: removing or reordering labels can leave dependent objects that prevent an automatic migration from applying.
Who it suits
DBDiff suits developers and database teams comparing MySQL, PostgreSQL, or SQLite databases and generating migration files. Its multiple output formats and runner commands may fit teams using different migration workflows.
Good to know, and what to watch
- Compares schemas and data across three database engines.
- Supports native SQL, Flyway, Liquibase, and Laravel output.
- Migration runner covers apply, rollback, and validation.
- Pre-built binaries are listed for Windows, macOS, and Linux.
- Free and released under the MIT license.
- Drop-table and drop-column migrations stop by default.
- PostgreSQL enum changes can leave migrations unappliable.
Getting started
- Open the DBDiff website
- Choose a pre-built binary, npm package, PHAR, Docker or Podman image, or Composer source installation
- Install the package for Windows, macOS, Linux, or your container environment
- Create a dbdiff.yml file with connections, drivers, scope, filters, and table settings
- Run a comparison and generate a migration in the required output format
Limits to check
By default, DBDiff stops generation for migrations that drop tables or columns unless destructive changes are enabled. PostgreSQL enum label removal or reordering may produce migrations that cannot apply when dependent objects are present.
The verdict
DBDiff covers database comparisons, migration generation, and migration management across MySQL, PostgreSQL, and SQLite. Review its documented enum limitation and default handling of destructive changes before relying on generated migrations.
Questions people ask
Which databases can DBDiff compare?
It supports MySQL, PostgreSQL, and SQLite, with listed compatibility for specific MySQL, PostgreSQL, and SQLite versions. Variants such as MariaDB, Aurora, PlanetScale, Neon, CockroachDB, YugabyteDB, TimescaleDB, and pgvector are also listed.
What migration formats are available?
Output options include native SQL, Flyway, Liquibase XML and YAML, Laravel Migrations, and custom templates.
Is DBDiff free?
Yes. It is free, open source, and released under the MIT license.
Where can it run?
Pre-built binaries are listed for Windows, macOS, and Linux. Packages and images are also available through npm, PHAR, Docker, Podman, and Composer.
Can it compare PostgreSQL row-level security?
Yes. It diffs row-level security policies and each table’s ENABLE and FORCE row-level security flags.
How does the Supabase option work?
The --supabase option selects the PostgreSQL driver and enables SSL. DBDiff reads the public schema, while Supabase-managed auth and storage schemas are outside the diff.
What the maker publishes
- Additional compatible databases
- The site says compatible variants include MariaDB, Aurora, PlanetScale, Neon, CockroachDB, YugabyteDB, TimescaleDB, and pgvector, with most not tested by the core team unless noted. source
- Configuration
- A dbdiff.yml configuration file can set database connections, drivers, diff scope, included or ignored tables and fields, and row filters. source
- Database compatibility
- The site lists support for MySQL 8.0.x, 8.4.x, and 9.3.x/9.6.x, PostgreSQL 14.x–16.x, and SQLite 3.x. source
- Database objects
- Its listed diff targets include tables, views, triggers, routines, types, sequences, row-level security policies, and data. source
- Database support
- It supports MySQL, PostgreSQL and SQLite; other versions may work but are not actively tested. source
- Deployment
- Multi-architecture Docker and Podman images are published to GHCR on each release. source
- Destructive changes
- By default, generation stops for migrations that drop a table or column; the page documents an option to allow those changes. source
- Distribution
- The site offers pre-built binaries, npm packages, a PHAR, Docker/Podman images, and Composer source installation. source
- Install options
- The site lists prebuilt binaries, npm, PHAR, Docker or Podman, and Composer source installation. source
- License
- The project is released under the MIT license. source
- License
- The project page identifies the license as MIT. source
- Limitations
- The site documents PostgreSQL enum label removals or reordering as a case where dependent objects may prevent an automatically generated migration from applying. source
- Migration formats
- It supports native SQL, Flyway, Liquibase XML and YAML, Laravel, and custom templates. source
- Migration integrations
- It supports output formats for Flyway, Liquibase, and Laravel Migrations, as well as native SQL and templates. source
- Migration runner
- It includes commands to create, apply, roll back, check, validate, repair, and baseline migrations. source
- Migration runner
- Built-in commands apply, roll back, check, validate, repair and baseline migrations. source
- Operating systems
- Prebuilt binaries are listed for Windows, macOS and Linux. source
- Performance
- The site says it has been tested on databases with millions of rows and that schema diffs use a constant number of round-trips regardless of table count. source
- Platforms
- Pre-built binaries are listed for Windows x64/arm64, macOS Intel/Apple Silicon, and Linux x64/arm64 using glibc or musl. source
- Purpose
- DBDiff compares two local or remote MySQL, PostgreSQL, or SQLite databases and automatically generates a migration file of their differences. source
- Purpose
- DBDiff compares local or remote databases and generates a migration file for their differences. source
- Schema and data diffs
- It can diff database schemas and data and generate SQL migrations, including up and down changes. source
- Schema and data diffs
- It can diff database objects including tables, views, triggers, routines, types, sequences, row level security policies and data. source
- Security feature
- For PostgreSQL, the tool diffs row level security policies and each table’s ENABLE and FORCE ROW LEVEL SECURITY flags. source
Checked against the maker's pages on 3 Oct 2026.