Tutorials

SQL, Mappers, and ORMs: Database Abstractions in Python

Wednesday, May 13th, 2026 1:30 p.m.–5 p.m. in Room 102A

Presented by

Mario Munoz

Description

Getting your Python code talking to a database requires an interface that links your code to bona fide database interactions.

In Python, low-level abstractions allow for SQL strings to be passed through database drivers, enabling database operations. At the highest end, there are Object Relational Mappers (ORMs), converting raw SQL operations into more Pythonic abstractions. There are also tools that exist in between, allowing for query mapping/organizing, while retaining certain advantages, like type safety and parameter/object handling.

Learn the differences between these tools and what some of their strengths and limitations might be in your particular workflows.

From the lowest level, we will work with aiosql, which allows you to write your database code in .sql files and load the SQL strings into your code.

On the highest level, we will look at Advanced Alchemy, a powerful companion library for SQLAlchemy, and see how it compares to Django's ORM.

We'll also look at some tools that fall somewhere in between. One of these is DBXS, a query organizer harnessing the power of Python's Protocol class to build database interfaces using a repository pattern. Lastly, we'll look at sqlspec, a type-safe query mapper designed for minimal abstraction between Python and SQL.

Search