Python · Building Real Applications · Intermediate · 32 min read
Python Databases with SQLAlchemy 2.0: Engines, Sessions, ORM Models, Queries, Transactions and Alembic Migrations
Work with relational databases from Python using SQLAlchemy 2.0. Covers Core versus ORM, engines and connection pools, declarative models with Mapped and mapped_column, relationships and loading strategies, the select-based query API, sessions and the unit of work, transactions and isolation, avoiding N+1 queries, bulk operations, migrations with Alembic, testing with transactions, async usage and common production problems.
Create an account to start
Create a free account to see what this lesson covers
- Every free lesson in every section, in full
- Track your progress and pick up where you left off
- Free practice questions and an incident simulation
- Takes under a minute: name, email and a password
No card needed. Full access to Python is a paid upgrade you can choose later.