fix-alembic-async-sqlalchemy

Correct Alembic migration configuration for async SQLAlchemy drivers.

Updated May 15, 2026
One-click install
npx skills add https://github.com/ruskibeats/t1d --skill fix-alembic-async-sqlalchemy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fix-alembic-async-sqlalchemy
Source: https://github.com/ruskibeats/t1d/tree/main/.pi/skills-archive/fix-alembic-async-sqlalchemy
Command: npx skills add https://github.com/ruskibeats/t1d --skill fix-alembic-async-sqlalchemy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill addresses issues that arise when using Alembic with async SQLAlchemy drivers like asyncpg or aiosqlite, where Alembic runs DDL synchronously and requires a sync engine.

Core Features & Use Cases

  • Fix Alembic Migrations: Corrects Alembic migration configuration errors caused by using async SQLAlchemy drivers.
  • Connection String Sanitization: Strips the async driver suffix from the connection string and uses create_engine.
  • Online and Offline Migrations: Provides guidance for rewriting run_migrations_online to use sync equivalents.
  • Safety and Verification: Ensures that the Alembic migration process runs smoothly without conflicts or errors.

Quick Start

Run the 'fix-alembic-async-sqlalchemy' skill to correct Alembic migration issues with async SQLAlchemy drivers.

Frequently Asked Questions about fix-alembic-async-sqlalchemy

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

FAQPage Schema
Why do Alembic migrations fail with async SQLAlchemy drivers?

Alembic migrations fail with async SQLAlchemy drivers because Alembic executes DDL synchronously and requires a sync engine, which conflicts with async drivers like asyncpg or aiosqlite.

How do I fix Alembic migration issues when transitioning to async SQLAlchemy?

Fix Alembic migration issues by sanitizing the connection string to strip the async driver suffix and rewriting run_migrations_online to use synchronous equivalents with create_engine.

Does Alembic support online and offline migrations with async SQLAlchemy?

Alembic supports online and offline migrations with async SQLAlchemy by providing guidance to rewrite run_migrations_online using sync equivalents, ensuring synchronous DDL execution without conflicts.

What is the best way to run Alembic DDL with an asyncpg connection string?

The best way to run Alembic DDL with an asyncpg connection string is to strip the async driver suffix from the connection and use create_engine for synchronous execution.

Are there limitations when using Alembic with async SQLAlchemy engines?

Limitations of using Alembic with async SQLAlchemy engines include migration failures caused by async engine usage, requiring connection string sanitization and synchronous engine compatibility to run smoothly.