PyData London 2024

No More Raw SQL: SQLAlchemy & ORMs
06-16, 11:45–12:25 (Europe/London), Salisbury

Managing a database and synchronizing service data representation with the database can be tricky. In this talk, we’ll explore SQLAlchemy, a powerful SQL toolkit, to simplify this task while also enhancing the readability and maintainability of the code. We’ll discuss how to leverage SQLAlchemy, it's powerful Object Relational Mapper (ORM) system, and even add some optimisations.


I’ll start by introducing SQLAlchemy, providing an overview of the toolkit and its components. Next, we’ll take a step-by-step approach with examples to demonstrate a demo service initially using raw SQL text. We’ll convert this service to use SQLAlchemy, then introduce ORMs to eliminate raw SQL queries. Finally, we’ll discuss some optimisations.


Prior Knowledge Expected

No previous knowledge expected

Rhythm Patel is a software engineer at Bloomberg. He is a part of Bloomberg's Python Guild, which is dedicated to aiding Python engineers, fostering innovation, creating and maintaining Python packages, as well as acting as a bridge to the wider Python community. Rhythm has spoken at PyCon US 2024, PyCon Italy 2024, PyCon Germany 2024, PyCon UK 2023, and other internal events. When he’s not working, you can find him playing football or tennis, traveling and hiking, or volunteering at London’s Royal Parks and London Zoo.