Integration Cheatsheet 03 — Pydantic ↔ SQLAlchemy Mapping
Cheatsheet: schema vs model separation, partial updates, ORM-to-API conversion, nested relations.
Cheatsheet: schema vs model separation, partial updates, ORM-to-API conversion, nested relations.
Cheatsheet: ARRAY column, contains / overlaps / ANY, GIN index, append/remove operations.
Cheatsheet: AsyncSession / Session, add/flush/commit/rollback, expire_on_commit, identity map, merge, scoped patterns.
Postgres index types via SQLAlchemy: B-tree, GIN, GiST, BRIN, HASH, partial, expression, INCLUDE indexes, and concurrent creation.
Schema in SQLAlchemy 2.0: typed mapped columns, Python types vs DB types, defaults, indexes, constraints, table_args.
Cheatsheet: TSTZRANGE / NUMRANGE / DATERANGE, INTERVAL, citext, INET / CIDR, exclusion constraints.
Cheatsheet: select() / where / order_by / limit / offset / joins / aggregates / subqueries / CTEs / window funcs.
Practical full-text search in Postgres via SQLAlchemy: tsvector, GIN, websearch_to_tsquery, ranking, and stemming.
Session deep dive: lifecycle, identity map, flush, commit, expire_on_commit, refresh, the unit of work.
Cheatsheet: pick the right Postgres index type for your access pattern.