SQLAlchemy + Postgres Cheatsheet 01 — asyncpg / psycopg Setup
Cheatsheet: driver selection, connection settings, PgBouncer-friendly config, RDS / Cloud SQL specifics.
Cheatsheet: driver selection, connection settings, PgBouncer-friendly config, RDS / Cloud SQL specifics.
Postgres-focused SQLAlchemy: asyncpg vs psycopg v3, connect_args, server settings, dialect specifics, and choosing your driver.
Cheatsheet: JSONB column, containment, path access, GIN index, jsonb_set, ON CONFLICT updates.
Postgres types in SQLAlchemy: JSONB queries, ARRAY operations, range types, citext, intervals, INET — with the dialect helpers.
Cheatsheet: ARRAY column, contains / overlaps / ANY, GIN index, append/remove operations.
Postgres index types via SQLAlchemy: B-tree, GIN, GiST, BRIN, HASH, partial, expression, INCLUDE indexes, and concurrent creation.
Cheatsheet: TSTZRANGE / NUMRANGE / DATERANGE, INTERVAL, citext, INET / CIDR, exclusion constraints.
Practical full-text search in Postgres via SQLAlchemy: tsvector, GIN, websearch_to_tsquery, ranking, and stemming.
Cheatsheet: expand-contract pattern, CONCURRENTLY index, FK validation in two phases, batched backfill.
Cheatsheet: pick the right Postgres index type for your access pattern.