What is an ORM

  • A layer of abstraction that sits between the database and us

  • We can perform all database operations though traditional Python code

  • No longer requires SQL

What do ORMs do?

  • Instead of manually defining tables in Postgres, we can define our table as python models

  • Queries can be made exclusively through python code

  • No SQL is necessary

SQLAlchemy

Official Documentation

FastAPI ORM Setup Documentation

  • Is one of the most popular python ORMs

  • Is a standalone library and has no association with FastAPI

  • It can be used with any other python web framework or any python based application

Last updated