finds.dev← search

// the find

sqlalchemy/alembic

★ 4,196 · Python · MIT · updated May 2026

A database migrations tool for SQLAlchemy.

Alembic is the standard database migration tool for SQLAlchemy projects. It manages schema versioning through a DAG of migration scripts, with autogenerate support that diffs your ORM models against the live database. If you're using SQLAlchemy, this is what you use — there's no real alternative.

Transactional DDL is on by default for databases that support it (Postgres, MSSQL), so a failed migration doesn't leave you with a half-applied schema. The DAG-based versioning (UUID revision IDs, explicit down_revision pointers) handles branching workflows — multiple feature branches with migrations can coexist and merge cleanly. SQLite batch mode is a genuine solution to SQLite's ALTER TABLE limitations, not a workaround you have to invent yourself. The autogenerate diff engine actually catches index and constraint changes, not just table/column additions.

Autogenerate misses a surprising amount in practice: computed columns, some check constraints, custom types, and anything database-specific that SQLAlchemy's reflection doesn't model. You will hand-edit generated migrations constantly. Data migrations have no first-class support — you drop into raw SQL or ORM calls inside migration scripts, which gets messy when models evolve out of sync with the migration that references them. The env.py setup is boilerplate-heavy and the async template is easy to wire incorrectly, leading to subtle issues where migrations run outside a transaction. Branch merges require explicit merge migrations, which can surprise teams coming from simpler tools.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →