EVERYTHING XIAOMI
Get listed
sqldef logo

sqldef

sqldef is a command-line tool for comparing SQL schemas and managing relational database migrations with standard SQL DDLs.

Place
#20 of 32
Score
5.9
sqldef's website

What sqldef is

sqldef is a command-line tool for comparing SQL schemas and managing relational database migrations with standard SQL DDLs. Users describe the intended schema in SQL; sqldef compares that definition with the current database and generates and applies the changes needed to match. The project lists support for MySQL, MariaDB, TiDB, PostgreSQL, SQL Server, and SQLite3. Operations are described as idempotent, so they can be run repeatedly. A dry-run mode previews changes without applying them, while offline mode compares SQL files without a database connection, including for validation and migration-script generation. An annotation can identify renamed tables, columns, indexes, and ENUM values. The project supplies single-binary executables and Docker images, and a GitHub Action can preview schema changes. An online browser demo uses a WebAssembly build to compare schemas and generate DDLs. sqldef is open source: source files use the MIT License, except for the parser, which uses Apache License 2.0. Debian packages are not currently available; Linux users are directed to binaries or Docker images.

Good

  • Supports six listed database systems.
  • Previews migrations without executing them.
  • Compares SQL files offline.
  • Provides a GitHub Action for previews.
  • Offers pre-built binaries and Docker images.

Watch out

  • Debian packages are not available.
  • Parser uses a different license from source files.

Who it suits

sqldef suits people managing database schemas through a complete SQL schema file, especially when they want migration previews or offline comparisons. Its listed databases include MySQL, PostgreSQL, SQL Server, and SQLite3.

Verdict

sqldef provides a SQL-file-centered workflow for schema comparison and migration, with preview and offline modes. Linux users should plan to use its binaries or Docker images rather than Debian packages.

The facts

Each one read from sqldef's own pages, with the date it was checked.

What it does

Audience
The README describes a workflow for database schema changes that uses a single SQL file containing the complete schema.checked 4 Oct 2026
Distribution
The project provides pre-built single-binary executables and Docker images.checked 4 Oct 2026
Idempotency
The README says sqldef operations are idempotent and safe to run multiple times.checked 4 Oct 2026
Idempotent operations
The project says its operations are safe to run multiple times.checked 4 Oct 2026
Integration
A GitHub Action is available to preview database schema changes.checked 4 Oct 2026
Integrations
The README links to a GitHub Action that previews database schema changes.checked 4 Oct 2026
License
The sqldef source files are distributed under the MIT License, while the parser is distributed under Apache License 2.0.checked 4 Oct 2026
Migration preview
The --dry-run option shows migrations without executing them.checked 4 Oct 2026
Offline mode
It can compare two SQL files without connecting to a database, including for CI/CD, schema validation, and migration script generation.checked 4 Oct 2026
Online demo
The official site says its online demo uses a WebAssembly build of sqldef to diff schemas and generate DDLs.checked 4 Oct 2026
Preview and offline modes
sqldef can preview migrations without executing them and compare SQL files without connecting to a database.checked 4 Oct 2026
Purpose
sqldef is a CLI tool for diffing SQL schemas and managing RDBMS migrations with regular SQL DDLs.checked 4 Oct 2026
Rename support
The README says the @renamed annotation supports renaming tables, columns, indexes, and ENUM values.checked 4 Oct 2026
Schema workflow
Users define a desired schema in SQL, and sqldef generates and applies migrations to bring the database to that state.checked 4 Oct 2026
Security and licensing
The README states that sqldef source files are distributed under the MIT License, except the parser, which is under Apache License 2.0.checked 4 Oct 2026
Support
The project invites feature requests through pull requests or GitHub Discussions.checked 4 Oct 2026
Supported databases
The site lists MySQL, MariaDB, TiDB, PostgreSQL, SQL Server, and SQLite3 as supported databases.checked 4 Oct 2026
Workflow
It compares a desired schema with the current schema and generates and applies DDLs to update the database.checked 4 Oct 2026

Where it runs

Browser demo
The online demo uses a WebAssembly build to diff two SQL schemas and generate DDLs.checked 4 Oct 2026
Linux limitation
The project says Debian packages are not currently available and recommends pre-built binaries or Docker images instead.checked 4 Oct 2026
Linux package limitation
The README says Debian packages are not currently available and directs Linux users to pre-built binaries or Docker images.checked 4 Oct 2026
Platforms
The releases page lists downloadable binaries for Windows, macOS (Darwin), and Linux.checked 4 Oct 2026

Alternatives to sqldef

All alternatives
  1. 1Atlas logo

    Atlas

    Free planOpen sourceWebAPILinuxmacOS
    8.3From $39 a month
  2. 2

    DeepFilterNet

    Free planOpen sourceAPILinuxmacOSSelf-hosted
    7.6Free plan
  3. 3

    pgroll

    Free planOpen sourceLinuxmacOSSelf-hostedWindows
    7.3Free plan
  4. 4Skeema logo

    Skeema

    Free planLinuxmacOSWindows
    6.9From $649 a year
  5. 5Bytebase Enterprise logo

    Bytebase Enterprise

    Free planWebAPISelf-hosted
    6.8From $20 a month
  6. 6

    Sqitch

    Free planLinuxmacOSSelf-hostedWindows
    6.7Free plan