Replies: 1 comment 1 reply
-
It will fail if you try to add it to the database. Seems somewhat nice also, that for DB classes, the DB validation is used. This has been discussed in several issues too, though, and IIRC folks have modified sqlmodel to do pydantic validation there also. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Commit to Help
Example Code
Description
Surprisingly, the code from the example will work without errors.
As far as I understand, the purpose of SQLModel is to take the best from SQLAlchemy and Pydantic, but as a user it was not obvious to me that adding table = true completely disables pydantic validation. Similar to "mobile first" in web design, maybe we can think about "pydantic first" style development, where by default we expect that if there are no errors, all data is correct?
Operating System
Windows
Operating System Details
Windows 11
SQLModel Version
0.0.8
Python Version
3.9.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions