How to Use ORM with SQLAlchemy 2.0 in Python

Learn the latest syntax of ORM in SQLAlchemy 2.0

Lynn G. Kwong
Python in Plain English
7 min readMay 5, 2024

--

Image by Maklay62 on Pixabay

With the advent of SQLAlchemy 2.0, there have been dramatic changes to the syntax of Object Relational Mapper (ORM). Especially, the ORMs are now defined differently with Mapped and mapped_column(). Besides, the Core-level SQL Expression Language is used extensively for ORMs, which we always tried to avoid…

--

--

I’m a Software Developer (https://medium.com/@lynn-kwong) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.