Skip to content
Discussion options

You must be logged in to vote

The latest Pydantic version includes "ORM mode", to solve these specific use cases.

I just finished a deep integration of it into FastAPI, just released it in version 0.30.0 🎉

Here are the new docs: https://fastapi.tiangolo.com/tutorial/sql-databases/

It should solve lazy-loading, hybrid-properties, dynamic attributes, relationships, and others. And it should work with all the ORMs, SQLAlchemy, Peewee, Tortoise ORM, GINO, etc.

You declare the data you want to export in Pydantic models and they take care of extracting it from your ORM models.

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by svlandeg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
Converted from issue

This discussion was converted from issue #194 on February 28, 2023 15:01.