This is the database-agnostic SQLAlchemy 2.0 textbook. For a Postgres-specific companion volume, see The Postgres-focused SQLAlchemy Textbook .
Pairs with FastAPI , Pydantic v2 , and Alembic .
This is the database-agnostic SQLAlchemy 2.0 textbook. For a Postgres-specific companion volume, see The Postgres-focused SQLAlchemy Textbook .
Pairs with FastAPI , Pydantic v2 , and Alembic .
Testing SQLAlchemy: real DBs via testcontainers, per-test transactions, factory_boy, async fixtures, and CI patterns.
Production SQLAlchemy: pool sizing with PgBouncer, read replica routing, OTEL instrumentation, multi-tenancy with RLS, and graceful failure modes.