Why does a SQLModel class with table=True
not validate data ?
#453
Labels
docs
Improvements or additions to documentation
investigate
question
Further information is requested
First Check
Commit to Help
Example Code
Description
When creating a SQLModel class instance, I thought that I'd have all the advantages of pydantic and SQLAlchemy classes toghether.
I was quite surprised when I realized that SQLModel classes created with
table=True
do not validate data as a pydantic class would do (see my example code).Having read about all SQLModel documentation, I didn't find anywhere this is stated.
Especially in https://sqlmodel.tiangolo.com/tutorial/fastapi/multiple-models/ it would make sense to explain that a
table=True
won't do data validation as a pydantic class would do.Maybe I did not understand the purpose of SQLModel enough, but this is quite disturbing for me.
I think it would be really nice to update the documentation regarding this particular point.
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
Python 3.10.7 x64
Additional Context
PS: Sorry, I'm comming here from Tortoise-ORM, and it's my first time using SQLModel, so I cannot guarantee that I will be quite helpful resolving issues here yet ;) I'll do my best.
The text was updated successfully, but these errors were encountered: