database
Installation
SKILL.md
Database Integration (SQLAlchemy Async + Alembic)
Overview
Use SQLAlchemy 2.0+ with async support as the database toolkit for FastAPI applications. SQLAlchemy provides both ORM (Object-Relational Mapping) and Core (SQL expression) layers. Pair with Alembic for schema migrations.
Key packages:
uv add "sqlalchemy[asyncio]" alembic asyncpg # PostgreSQL
# or
uv add "sqlalchemy[asyncio]" alembic aiosqlite # SQLite
sqlalchemy[asyncio]-- async engine and session supportasyncpg-- high-performance async PostgreSQL driveraiosqlite-- async SQLite driveralembic-- database migration tool