dbconform

Finds and repairs drift between a SQL database and its SQLAlchemy models

Inspects a live SQLite or PostgreSQL database, compares it with SQLAlchemy or SQLModel models and plans dependency-ordered steps for tables, columns, keys, constraints, indexes and comments. Runs in-process, sync or async, with no migration files or history table.

Trade-offs

  • Add and alter only by default: dropping extra tables or columns and shrinking a column each need an explicit flag, so extra objects stay as warnings.
  • A NOT NULL column on a table with rows is skipped unless backfill is enabled, which runs add nullable, UPDATE from a declared source, then SET NOT NULL.
  • SQLite can't add CHECK, UNIQUE or foreign keys with ALTER TABLE, so the table is rebuilt (create, copy, drop, rename) keeping data and indexes, unless rebuilds are turned off.

Q&A4

Alembic works when migrations start clean and stay linear, but it has no answer once the database diverges from the migration history. dbconform needs no history: it compares the live database with the models each time.

Reviews

Loading reviews

    More in Migrations

    See all 7 →
    • PaganelData migration engine that verifies the destination down to the row
    • MigrationPilotPostgreSQL migration linter that blocks unsafe DDL before merge
    • pistachioDeclarative PostgreSQL schema management with a plan and apply workflow
    • FlydbVersioned database migrations with a local GUI, a CLI and agent hand-off
    • pgmoldPostgreSQL schema-as-code in plain SQL, with safety linting and drift checks
    • terradbDeclarative schema management for PostgreSQL and SQLite

    More in Database internals

    See all 29 →
    • FeOxDBEmbedded key-value store in Rust with write-behind durability
    • SNKVEmbedded key-value store built directly on SQLite's B-tree
    • RuvioRust key-value server that speaks RESP, with locks and queues as commands
    • musqlSQLite-compatible SQL engine on columnar storage and a JIT
    • EgresPostgres-compatible database in Zig for heavy, multi-tenant workloads
    • MongrelDBEmbedded Rust database with vector, sparse and text indexes

    More in Python

    See all 162 →
    • jobdGPU-aware job broker for a few personal machines, with an MCP server
    • RaspiMIDIHubRaspberry Pi as a plug-and-play USB MIDI hub with virtual instruments
    • blitcpFile copier that reads in disk order, dedupes and streams over raw SSH
    • gnss_gpuGPU GNSS positioning for urban canyons with particle filters and ray-traced NLOS
    • SnitchPer-app network monitor and outbound firewall for the desktop
    • HisabDouble-entry ledger kept by texting a WhatsApp agent, in Urdu or English