Alembic Textbook Ch. 1 — Introduction and Setup
Alembic basics: setup with SQLAlchemy 2.0, env.py for sync/async, naming conventions, the migration directory.
Alembic basics: setup with SQLAlchemy 2.0, env.py for sync/async, naming conventions, the migration directory.
Pydantic v2 mental model: validation (input → model), serialization (model → output), the Rust core, and what changed from v1.
Postgres-focused SQLAlchemy: asyncpg vs psycopg v3, connect_args, server settings, dialect specifics, and choosing your driver.
SQLAlchemy 2.0 introduction: Core vs ORM, the unified API, engine + connection, basic select / insert / update / delete.
FastAPI architecture: ASGI, Starlette, Pydantic, dependency injection, and the design choices that make it tick.
What Alembic autogenerate detects (tables, columns, indexes, constraints) and what it doesn’t (data migrations, complex changes, defaults), plus a review checklist.
Field declaration, types (str, int, datetime, UUID, Decimal, EmailStr, HttpUrl), constraints, defaults, aliases.
Postgres types in SQLAlchemy: JSONB queries, ARRAY operations, range types, citext, intervals, INET — with the dialect helpers.
Engine and connection management: pool types, sizing, pre-ping, recycle, events, debugging.
Path operations, parameter declaration (path / query / body / header / cookie / form / file), routers, prefixes, dependencies on routers, and request internals.