Skip to main content
New Self-paced AI courses — learn ML, deep learning, and agents on your schedule. Enroll free

Python and FastAPI

Module 24 · Databases with FastAPI and SQLAlchemy

ORM concepts, SQLAlchemy 2.0 models and sessions, CRUD, relationships, migrations with Alembic, async databases, transactions, pooling and repository patterns.

9 lessons Follow in order
Use the button below to sign in and unlock lessons.
Your path

Lessons in sequence

Work through these in order—each lesson builds on the previous one.

  1. Lesson 1 of 9

    24.1 ORM concepts and SQLAlchemy Core

    Enroll to open · 24 min read

  2. Lesson 2 of 9

    24.2 SQLAlchemy models, sessions and the unit of work

    Enroll to open · 24 min read

  3. Lesson 3 of 9

    24.3 A database dependency and CRUD endpoints

    Enroll to open · 24 min read

  4. Lesson 4 of 9

    24.4 Relationships: one-to-many and many-to-many

    Enroll to open · 24 min read

  5. Lesson 5 of 9

    24.5 Pagination, filtering and sorting

    Enroll to open · 24 min read

  6. Lesson 6 of 9

    24.6 Database migrations with Alembic

    Enroll to open · 26 min read

  7. Lesson 7 of 9

    24.7 Async SQLAlchemy and aiosqlite

    Enroll to open · 26 min read

  8. Lesson 8 of 9

    24.8 Transactions, the N+1 problem and query performance

    Enroll to open · 30 min read

  9. Lesson 9 of 9

    24.9 PostgreSQL, connection pooling and the repository pattern

    Enroll to open · 30 min read

← Back to course