dbdiff

Windows · Mac · Linux · Self-hosted

Freedom report

Two barsScore 5.5

  • Free tierNo free tier on record
  • Open codeNo open-source code on record
  • Runs widely3 of 6 device platforms
  • DocumentedPlans, terms and facts published

DBDiff compares local or remote MySQL, PostgreSQL, and SQLite databases and generates migration files from schema or data differences. Generated migrations can include both up and down changes. Its runner provides commands to create, apply, roll back, check, validate, repair, and baseline migrations. Comparison targets include tables, views, triggers, routines, types, sequences, row-level security policies, and data. Migration output options include native SQL, Flyway, Liquibase, Laravel Migrations, and custom templates. A configuration file can specify connections, drivers, comparison scope, included or ignored tables and fields, and row filters. Installation 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. For PostgreSQL, DBDiff can compare row-level security policies and table security flags. By default, generation stops if a migration would drop a table or column, though an option permits those changes. One documented PostgreSQL limitation is that removing or reordering enum labels may leave dependent objects that prevent an automatic migration from applying. DBDiff is free and released under the MIT license.

Who it is for

DBDiff may suit developers and database teams who need to compare MySQL, PostgreSQL, or SQLite databases and produce migrations. Its runner and multiple output formats support different migration workflows.

What is good

  • Free and released under the MIT license.
  • Compares schema and data across three database engines.
  • Generates migrations with up and down changes.
  • Supports Flyway, Liquibase, Laravel, and custom templates.
  • Pre-built binaries are listed for Windows, macOS, and Linux.

What to know first

  • PostgreSQL enum changes can leave dependent objects blocking migrations.
  • Other database versions may not be actively tested.
  • Drop-table and drop-column migrations stop by default.

Freedom251 review

dbdiff: the full review

DBDiff combines database comparison, migration generation, and migration management for three named database engines. Review its documented PostgreSQL enum limitation and default safeguards around destructive changes before relying on generated migrations.

Overview

DBDiff is an open-source command-line tool for comparing local or remote MySQL, PostgreSQL, and SQLite databases and producing reversible SQL migrations. It suits developers and database teams that want comparison and migration management across more than one engine without a paid plan. Its breadth is useful, but engine-specific limitations and the need to review destructive changes make it a poor fit for unattended migration generation.

DBDiff is released under the MIT license. For a wider selection, see our Database Schema Comparison Tools list.

Key features

Compare schemas and data

DBDiff can compare schema objects and data, including tables, views, triggers, routines, types, sequences, and row-level security policies. A dbdiff.yml file can define connections and drivers, set comparison scope, include or ignore tables and fields, and apply row filters. That flexibility is valuable for targeted comparisons, though it also puts responsibility on the operator to configure the scope correctly.

Generate and manage migrations

Generated changes can include both up and down migrations, with output for native SQL, Flyway, Liquibase XML or YAML, Laravel Migrations, and custom templates. Commands cover creating, applying, rolling back, checking, validating, repairing, and baselining migrations, making DBDiff more than a one-off comparison utility.

Generation stops by default when a change would drop a table or column, a sensible safeguard for teams reviewing migrations before deployment. An option allows those changes, but enabling it makes careful review essential. PostgreSQL enum label removals or reordering can also produce migrations that fail when dependent objects block the change.

Engine coverage and performance

Core support covers MySQL 8.0.x, 8.4.x, and 9.3.x/9.6.x; PostgreSQL 14.x–16.x; and SQLite 3.x. Compatible variants include MariaDB, Aurora, PlanetScale, Neon, CockroachDB, YugabyteDB, TimescaleDB, and pgvector, although most are not actively tested by the core team. For Supabase, the PostgreSQL driver uses SSL and reads the public schema, not managed schemas such as auth or storage.

The project says it has been tested with databases containing millions of rows and that schema comparisons use a constant number of round-trips regardless of table count. PostgreSQL comparisons also include row-level security policies and each table's ENABLE and FORCE settings.

Pricing

DBDiff is free and open source, with no paid plan or seat-based tier. Its MIT license permits use without a subscription, while commercial support enquiries are invited separately.

Platforms

DBDiff supports Linux, macOS, Windows, and self-hosted deployment. Pre-built binaries are offered for Windows, macOS, and Linux; other installation routes include npm, PHAR, Docker or Podman images, and Composer source installation. Multi-architecture Docker and Podman images are published to GHCR with each release.

Who it's for

DBDiff is a strong match for developers and teams working across MySQL, PostgreSQL, or SQLite who need schema and data diffs alongside migration generation and lifecycle commands. It is less suitable when teams need dependable automated handling of PostgreSQL enum changes, or when they rely on Supabase-managed schemas outside public.

Pros and cons

  • Pros: One free, MIT-licensed tool handles schema and data comparisons across three database engines.
  • Pros: Multiple migration output formats and commands for applying, rolling back, validating, and repairing changes support a fuller deployment workflow.
  • Pros: Default blocks on table and column drops reduce the chance of generating destructive migrations without review.
  • Cons: PostgreSQL enum label removal or reordering may fail when dependent objects prevent the generated migration from applying.
  • Cons: Supabase comparisons exclude managed schemas such as auth and storage.
  • Cons: Many compatible database variants are not actively tested by the core team, so teams on those systems should validate behavior before relying on it.

Alternatives

  • DBDiff is another free, open-source DBDiff listing, described by Akal Software, a London-based technology consultancy.
  • dbForge Studio for PostgreSQL is worth considering for a PostgreSQL-focused alternative with a free Express tier and a paid Standard plan.
  • Skeema offers a free Community tier covering tables, stored procedures and functions, plus 18 linter checks; choose it if that scope and Linux or macOS support fit your needs.
  • sqldef is a free MIT-licensed CLI option for those seeking an open-source alternative.
  • pgquarrel is a free BSD-3-Clause option for readers considering another database comparison tool.
  • apgdiff is another free alternative.
  • driftcurve is a free web-based alternative.
  • UserFolderMigrator is a free Windows alternative.

Verdict

Choose DBDiff if you need a free, cross-platform tool that combines multi-engine schema and data comparison with migration generation and management. Its format support and protective default around drops are persuasive strengths; look elsewhere if your workflow depends on Supabase-managed schemas or automatic PostgreSQL enum changes that must apply without manual intervention.

Compared on database schema comparison tools

Migration scripts
Yes
Database scope
multi-engine
CI/CD integration
Yes
Supported platforms
cross-platform

Best dbdiff alternatives

See all 18