No More Raw SQL: SQLAlchemy, ORMs & asyncio
summary
Claims that raw SQL becomes unnecessary by using SQLAlchemy’s core, ORM and SQLAlchemy asyncio extension to run the same service both synchronously and asynchronously. Demonstrates a FastAPI marketplace (customers, orders, order_items) backed by sqlite (postgress variant available), builds engines/sessions, shows emitted SQL, uses select()/func.sum() and async_sessionmaker/task groups, and commits inserts; examples run in Codespaces and the example service actually works with logged queries and successful commits.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:30Bloomberg Python contributions
- 8:12Workshop setup
- 27:26From raw SQL to SQLAlchemy
- 49:06SQLAlchemy ORM
- 1:09:01Query optimization
- 1:21:41Introduction to asyncio
- 1:38:18SQLAlchemy with asyncio
- 1:57:31Code review
related talks
30mThe magic of SQLAlchemy
28mThe Ultimate Python Database Toolkit: SQLAlchemy
40mOptimize Your Database Operations with Asynchronous Processing
30mBuilding modern Python web apps with PostgreSQL
01h 44mTUTORIAL: SQLAlchemy 2.0
32mUnlearning SQL
32mAsynchronous Django: Unlocking the Power of Async Programming
23mBuilding a multi-purpose platform for bulk data using sqlalchemy
