Pydantic v2 Textbook Ch. 4 — Serialization in Depth

Output side: model_dump, model_dump_json, field/model serializers, exclude/include, mode=python/json, by_alias.

May 9, 2026 · 3 min · 616 words · Manvendra Rajpoot

SQLAlchemy 2.0 Textbook Ch. 4 — The Session and the Unit of Work

Session deep dive: lifecycle, identity map, flush, commit, expire_on_commit, refresh, the unit of work.

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

Python Cheatsheet 05 — Iterators, Generators, and Comprehensions

Cheatsheet: iter/next, generators, async generators, comprehensions, itertools.

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

Integration Cheatsheet 05 — Auth Stack (Password / JWT / Session)

Cheatsheet: full auth stack — User model, login endpoint, token deps, refresh, password hashing.

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

Alembic Cheatsheet 05 — Online (Zero-Downtime) Schema Changes

Cheatsheet: expand-contract pattern, CONCURRENTLY index, FK validation in two phases, batched backfill.

May 15, 2026 · 3 min · 584 words · Manvendra Rajpoot

Pydantic Cheatsheet 05 — Discriminated Unions and Generics

Cheatsheet: discriminator field, callable Discriminator, Generic[T] models, recursive references.

May 14, 2026 · 2 min · 422 words · Manvendra Rajpoot

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

Alembic Textbook Ch. 5 — Online Schema Changes (Zero-Downtime Patterns)

Zero-downtime migrations: expand-contract, batched backfills, CONCURRENTLY, NOT VALID FK, and pg_repack.

May 10, 2026 · 4 min · 783 words · Manvendra Rajpoot

Pydantic v2 Textbook Ch. 5 — Nested Models, Generics, and Discriminated Unions

Composing models: nesting, generics with TypeVars, discriminated unions, recursive models.

May 9, 2026 · 3 min · 471 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