Alembic
alembic.sqlalchemy.org
- Free plan
- Self-hosted
What Alembic is
Alembic is free, self-hosted software for creating, managing, and invoking relational database migration scripts with SQLAlchemy. A project keeps its migration environment alongside source code. Its autogeneration compares a database schema with application metadata and produces a candidate migration for manual review and editing. Alembic can instead generate SQL scripts without connecting to a database, supporting workflows where DDL access is restricted. SQLite batch operations handle limited ALTER TABLE support by copying data into a newly structured table and replacing the previous table. Documented dialects include PostgreSQL, MySQL, MariaDB, SQLite, and Microsoft SQL Server. The tool supports Python 3.10 and newer and requires SQLAlchemy 2.0.0 or newer; installation is available through pip. Autogeneration does not reliably detect table or column renames. Offline SQL generation also cannot handle migrations needing client/server access, such as SELECT queries. Alembic is part of the SQLAlchemy project and uses an MIT license.
Who it suits
It suits Python teams using SQLAlchemy who need source-controlled database migrations. It is also relevant where offline SQL generation or SQLite schema workarounds are required.
Good to know, and what to watch
- Free MIT-licensed software
- Works with multiple database dialects
- Generates candidate migrations automatically
- Supports offline SQL output
- Handles SQLite batch operations
- Rename detection is unreliable
- Offline mode cannot run database queries
- Requires Python 3.10 or newer
- Requires SQLAlchemy 2.0.0 or newer
Plans
Every plan and priceAlembic
Free plan
The verdict
Alembic provides code-based migrations, schema comparison, offline SQL generation, and SQLite-specific batch support for SQLAlchemy projects. Manual review remains important, especially for renames and migrations that need live database access.
What the maker publishes
- Autogenerate
- Alembic compares database schema with application metadata to generate candidate migration scripts that users review and edit by hand. source
- Autogenerate limitation
- Autogenerate does not reliably identify table or column renames and its candidate migrations must be manually reviewed and corrected. source
- Database ecosystem
- Alembic uses SQLAlchemy and database drivers, and its documentation describes PostgreSQL, MySQL, MariaDB, SQLite, and Microsoft SQL Server dialect implementations. source
- Installation
- Alembic can be installed with pip and is commonly installed in a project-local Python virtual environment. source
- License
- The repository license grants permission to use, copy, modify, distribute, and sell the software, subject to its stated conditions. source
- Maintainer
- Alembic is developed by Mike Bayer and is part of the SQLAlchemy project. source
- Migration scripts
- A project's migration environment is created once and maintained with its source code. source
- Offline limitation
- Migration scripts that need client/server database access, such as pulling rows with SELECT, will not work in offline SQL generation mode. source
- Offline SQL
- Alembic can generate SQL scripts for migrations instead of running them against a database, including for workflows where DDL access is restricted. source
- Python support
- Alembic supports Python 3.10 and newer and requires SQLAlchemy 2.0.0 or newer. source
- SQLite migrations
- Batch operations support SQLite's limited ALTER TABLE capabilities by copying data into a newly structured table and replacing the old table. source
- Support
- The project directs users to GitHub Discussions for bug and feature discussion and its GitHub issue tracker for bug reports and feature requests. source
- What it does
- Alembic is a lightweight database migration tool for use with SQLAlchemy and provides tools to create, manage, and invoke relational database change scripts. source
Checked against the maker's pages on 3 Oct 2026.