Pydbantic vs SQL Model #38
-
I think this project is trying to do the same thing as https://sqlmodel.tiangolo.com/ Is that right? How's Pydbantic different? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @jackrsteiner , I created pydbantic around the same time sqlmodel was released to accomplish the same problem, of bridging pydantic and sqlalchemy models together. I see sqlmodel as a bit of an enhanced sqlalchemy with improved ide hinting. sqlmodel follows sqlalchemy much more closely by the way queries are built, and objects are created / updated. pydbantic mainly differs from sqlmodel by interfaces. pydbantic attempts to mimic django-like data access and model creation and attempts to encapsulate all the required metdata to query, create, update or delete saved objects by importing the model needed. Creating a many to many relationships in pydbantic, is a bit simpler, as the relationship is maintained by the references in a models annotations, not through a tertiary link model relationship definition. pydbantic has recently introduced support for alembic migrations, but also can automatically handle most migrations automatically at startup. This is not an exhaustive comparison, but what is currently top of mind. |
Beta Was this translation helpful? Give feedback.
Hey @jackrsteiner , I created pydbantic around the same time sqlmodel was released to accomplish the same problem, of bridging pydantic and sqlalchemy models together.
I see sqlmodel as a bit of an enhanced sqlalchemy with improved ide hinting. sqlmodel follows sqlalchemy much more closely by the way queries are built, and objects are created / updated.
pydbantic mainly differs from sqlmodel by interfaces. pydbantic attempts to mimic django-like data access and model creation and attempts to encapsulate all the required metdata to query, create, update or delete saved objects by importing the model needed. Creating a many to many relationships in pydbantic, is a bit simpler, as the relati…