Integration Cheatsheet 01 — Full-Stack Project Skeleton
Cheatsheet: directory layout, pyproject, lifespan, db / settings / models / api wiring.
Cheatsheet: directory layout, pyproject, lifespan, db / settings / models / api wiring.
Cheatsheet: driver selection, connection settings, PgBouncer-friendly config, RDS / Cloud SQL specifics.
Cheatsheet: create_engine / create_async_engine, pool params, pre-ping, recycle, events, lifespan integration.
Alembic basics: setup with SQLAlchemy 2.0, env.py for sync/async, naming conventions, the migration directory.
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.
Cheatsheet: JSONB column, containment, path access, GIN index, jsonb_set, ON CONFLICT updates.
Cheatsheet: DeclarativeBase, Mapped/mapped_column, type mappings, server_default, indexes, unique/check/FK, naming conventions.
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.