Python FastAPI Tutorial - Adding a Database - SQLAlchemy Models and Relationships - Part 5
Corey Schafer via YouTube
-
70
-
- Write review
Learn Generative AI, Prompt Engineering, and LLMs for Free
Become an AI & ML Engineer with Cal Poly EPaCE — IBM-Certified Training
Overview
Google, IBM & Meta Certificates — All 10,000+ Courses at 40% Off
One annual plan covers every course and certificate on Coursera. 40% off for a limited time.
Get Full Access
Learn how to integrate a database into your FastAPI application using SQLAlchemy in this comprehensive tutorial. Transition from storing data in Python lists that reset on server restart to implementing a persistent SQLite database with proper SQLAlchemy models and relationships between users and posts. Explore the distinction between SQLAlchemy models and Pydantic schemas, understand their respective roles in database operations and API serialization, and master FastAPI's dependency injection system for managing database sessions. Discover best practices for structuring database-driven applications and gain insights into scaling your SQLite setup to production databases like PostgreSQL or MySQL. Build a solid foundation for creating robust, persistent FastAPI applications with proper data modeling and relationship management.
Syllabus
Python FastAPI Tutorial (Part 5): Adding a Database - SQLAlchemy Models and Relationships
Taught by
Corey Schafer