SQLAlchemy Cheatsheet 05 — Relationships and Loading Strategies

Cheatsheet: relationship(), back_populates, secondary, cascade, joinedload / selectinload / subqueryload, lazy options.

May 12, 2026 · 3 min · 470 words · Manvendra Rajpoot

Postgres SQLAlchemy Textbook Ch. 5 — Locking, Advisory Locks, and SKIP LOCKED

Postgres locking patterns: SELECT FOR UPDATE, NOWAIT, SKIP LOCKED, advisory locks, application locks, deadlock retry.

May 8, 2026 · 4 min · 651 words · Manvendra Rajpoot

SQLAlchemy 2.0 Textbook Ch. 5 — Querying with select()

Selecting rows in SQLAlchemy 2.0: select(), where, joins, group_by, aggregates, subqueries, CTEs, scalars vs rows.

May 7, 2026 · 5 min · 952 words · Manvendra Rajpoot

Integration Cheatsheet 06 — Multi-Tenancy Across the Stack

Cheatsheet: tenant context, RLS policies, per-request session, isolation tests.

May 16, 2026 · 3 min · 627 words · Manvendra Rajpoot

SQLAlchemy + Postgres Cheatsheet 06 — Full-Text Search

Cheatsheet: generated tsvector, websearch_to_tsquery, ts_rank, headline snippets, trigram hybrid.

May 13, 2026 · 3 min · 474 words · Manvendra Rajpoot

SQLAlchemy Cheatsheet 06 — Transactions and Concurrency

Cheatsheet: session.begin, begin_nested, isolation levels, with_for_update, optimistic locking, deadlock retry.

May 12, 2026 · 2 min · 413 words · Manvendra Rajpoot

Postgres SQLAlchemy Textbook Ch. 6 — LISTEN / NOTIFY for Pub/Sub

LISTEN/NOTIFY patterns: real-time event delivery, queue wake-up, payload limits, and combining with the outbox pattern.

May 8, 2026 · 3 min · 553 words · Manvendra Rajpoot

SQLAlchemy 2.0 Textbook Ch. 6 — Relationships and Loading Strategies

Relationship() in depth: configuration, loading strategies, N+1 prevention, association tables, polymorphic patterns.

May 7, 2026 · 5 min · 884 words · Manvendra Rajpoot

SQLAlchemy + Postgres Cheatsheet 07 — Locking, SKIP LOCKED, Advisory Locks

Cheatsheet: row locking, NOWAIT, SKIP LOCKED queue, advisory locks (session and tx scoped).

May 13, 2026 · 3 min · 535 words · Manvendra Rajpoot

SQLAlchemy Cheatsheet 07 — Async Patterns and Streaming

Cheatsheet: AsyncEngine, AsyncSession, lazy loading caveats, streaming results, run_sync escape hatch.

May 12, 2026 · 3 min · 441 words · Manvendra Rajpoot