First Check
Commit to Help
Example Code
fromtypingimportOptionalfrompydanticimportBaseModelfromsqlmodelimportField, SQLModelclassUser1(SQLModel, table=True):
id: Optional[int] =Field(primary_key=True)
name: strclassUser2(BaseModel):
name: strUser1()
User2()
Description
- Create SQLModel
- Create equivalent pydantic model
- Create instance of SQLModel without providing required arguments
- Create instance of pydantic model without providing required arguments
The pydantic model raises an ValidationError whereas the SQLModel doesn't raise a ValidationError even though an required argument is not provided. I would expect a ValidationError if not all required arguments is provided.
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
Python 3.8.5
Additional Context
No response
First Check
Commit to Help
Example Code
Description
The pydantic model raises an ValidationError whereas the SQLModel doesn't raise a ValidationError even though an required argument is not provided. I would expect a ValidationError if not all required arguments is provided.
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
Python 3.8.5
Additional Context
No response