SQLAlchemy ORM Fundamentals
Get started with SQLAlchemy's Object Relational Mapper (ORM) to define database models and interact with your database.
Bridging Code and Databases
Welcome to SQLAlchemy ORM! You'll learn how to connect your Python code to a database in a powerful, object-oriented way.
An Object Relational Mapper (ORM) is a tool that helps you interact with a database using objects from your programming language, instead of writing raw SQL.
- It maps database tables to Python classes.
- It maps database rows to Python objects.
- It maps database columns to Python attributes.
This makes database operations feel more like working with regular Python objects.
Meet SQLAlchemy: Your ORM Tool
SQLAlchemy is a comprehensive and powerful ORM for Python. It provides a full suite of well-known persistence patterns for efficient and high-performing database access.
We'll focus on its ORM capabilities, which allow you to define your database structure (schema) using Python classes and interact with data using instances of those classes.
It supports many databases, including SQLite, PostgreSQL, MySQL, and more!
All lessons in this course
- SQLAlchemy ORM Fundamentals
- Connecting FastAPI to PostgreSQL
- CRUD Operations with SQLAlchemy
- Database Migrations with Alembic