Thursday 9 a.m.–12:20 p.m.

Introduction to SQLAlchemy

mike bayer

Audience level:


The goal of the tutorial is a broad-based introduction to SQLAlchemy, spanning the Core and ORM components as well as the systems that underlie them. The tutorial takes the "harder" approach teaching from fundamentals first, emphasizing details on how the library interacts with the database and SQL and concluding with an introduction to the ORM, providing a solid perspective for continued study.


In contrast to ORM tutorials which might begin with applied object-relational examples, this tutorial takes the opposite approach of building up from underlying and core components first, moving first through relational database concepts into the Python DBAPI, then describing the SQLAlchemy Core, the SQL Expression Language, and finally the ORM. In terms of learning SQLAlchemy, this is the harder road to travel, and at the end the ORM component itself will only have been roughly introduced. However, the goal is so that new users would leave with a solid grasp on what exactly SQLAlchemy is doing and how it's doing it, so that their future endeavors in continuing to learn about ORMs, SQLAlchemy or not, is informed by a rough understanding of the underlying fundmantals of interacting with a database.

Student Handout