AI engineering glossary · SQL databases
What is ORM (object-relational mapper)?
Object-relational mapper (also called ORM): A library that lets code use programming-language objects to read and write database rows, generating SQL behind the scenes. SQLAlchemy and Django ORM are examples. It saves boilerplate but can hide inefficient queries.
Object-relational mapper: an example
In Python, session.query(User).filter_by(city='Pune') becomes a SELECT with a WHERE clause.
Related terms
More SQL databases terms
- One-to-many relationship
- ORDER BY
- Parameterised query
- PARTITION BY
- Phantom read
- PostgreSQL
- Primary key
- Query optimizer
Where you learn it
Object-relational mapper is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.