What problem does it solve?
This skill resolves production database write-lock issues and scalability limits caused by running a FastAPI/SQLAlchemy/Alembic app on SQLite by guiding a safe migration to PostgreSQL.
Core Features & Use Cases
- DSN migration for SQLAlchemy (async + Alembic): Switches from a SQLite file-backed connection to a PostgreSQL host/port/database/user DSN while aligning asyncpg/psycopg2 expectations.
- Alembic schema alignment: Helps you stamp or re-initialize PostgreSQL schema so migrations continue to work correctly after the backend switch.
- Data transfer + SERIAL sequence recovery: Moves data via table-by-table CSV extraction and PostgreSQL COPY, then repairs SERIAL/IDENTITY sequences to prevent duplicate key failures.
- Verification and rollback planning: Provides row-count and sample-query checks and a rollback approach by reverting the application to SQLite and handling potential new data loss.
Quick Start
Instruct the AI to produce a step-by-step SQLite-to-PostgreSQL migration plan for a FastAPI/SQLAlchemy/Alembic service experiencing "database is locked" under high concurrency, including Alembic strategy, data transfer method, SERIAL sequence repair, and verification commands.