Moving to SQLAlchemy 2.0: Replacing session.query() with select()
Stop using session.query(). Learn how SQLAlchemy 2.0's unified select() API decouples query construction from execution for better typing and composability.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Stop using session.query(). Learn how SQLAlchemy 2.0's unified select() API decouples query construction from execution for better typing and composability.
A step‑by‑step diagnostic guide for SQLAlchemy 1.4+ joinedload() problems: recognize symptoms, run quick checks, apply targeted fixes, and know when to escalate.
Choose the proper eager-loading strategy for SQLAlchemy relationships to avoid N+1 queries while managing memory usage. This guide compares joinedload, selectinload, subqueryload, and lazy loading with practical examples and validation steps.
SQLAlchemy 2.0’s async engine can cut latency for high‑concurrency workloads, but it adds complexity. This blog walks through the problem, setup, a worked example, trade‑offs, and actionable take‑aways for deciding whether to go async.
Stop leaking database connections in FastAPI. Learn how to use 'Depends' and 'yield' to automate session lifecycles and decouple resource management from your business logic.
Learn how to implement a non-blocking database read/write path using SQLAlchemy 2.0 AsyncSession and QueuePool, including session lifecycle management and operational monitoring.
Learn how SQLAlchemy’s hybrid_property lets you expose computed fields that behave the same in Python objects and SQL queries. The post walks through a concrete example, trade‑offs, and practical debugging tips.
Guide to decide between SQLAlchemy's joinedload and selectinload eager loaders, showing trade‑offs, code examples, and validation steps.
Stop your database from choking on N+1 queries. Learn when to use joinedload vs. selectinload in SQLAlchemy to optimize relationship loading and reduce latency.