fastapi-alembic-setup

Configure Alembic for async SQLAlchemy migrations in PostgreSQL-backed FastAPI projects.

3|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/agusmdev/burntop --skill fastapi-alembic-setup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fastapi-alembic-setup
Source: https://github.com/agusmdev/burntop/tree/main/.claude/skills/fastapi-alembic-setup
Command: npx skills add https://github.com/agusmdev/burntop --skill fastapi-alembic-setup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers configure and manage Alembic-based migrations for asynchronous SQLAlchemy in FastAPI projects, simplifying database schema evolution with PostgreSQL.

Core Features & Use Cases

  • Initialization: Create and configure Alembic in the project root, including env.py for async migrations.
  • Migration Workflow: Generate and apply migrations using online and offline modes, with autogenerate support powered by Base.metadata imports.
  • Project Compatibility: Works with FastAPI apps and PostgreSQL-backed databases, aligning with typical backend development workflows.

Quick Start

Initialize Alembic in your project root and generate the initial migration for the current models.

Frequently Asked Questions about fastapi-alembic-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Alembic for async SQLAlchemy migrations in a FastAPI project?

Configure Alembic for async SQLAlchemy in FastAPI by initializing it in the project root, setting up env.py for async migrations, and importing Base.metadata from your models to enable autogenerate support for PostgreSQL.

What is the best way to run database migrations with FastAPI and PostgreSQL asynchronously?

The best way to run FastAPI PostgreSQL migrations asynchronously is by using Alembic's online and offline migration commands, configured specifically for async SQLAlchemy to manage database schema evolution seamlessly.

Does Alembic autogenerate work with async SQLAlchemy in FastAPI?

Yes, Alembic autogenerate works with async SQLAlchemy by importing Base.metadata from your models into the migration environment, allowing automatic detection of schema changes for PostgreSQL-backed FastAPI projects.

How do I set up Alembic environment files for local development and production FastAPI workflows?

Set up Alembic environment files for FastAPI by configuring env.py to handle async migrations, providing migration script templates that support both local development and production workflows for PostgreSQL databases.

Can I use Alembic offline migrations with an async FastAPI and PostgreSQL setup?

Yes, you can use Alembic offline migrations with an async FastAPI and PostgreSQL setup, generating SQL scripts without a live database connection, alongside online migrations for direct application.