Replies: 3 comments
-
|
What is the type of |
Beta Was this translation helpful? Give feedback.
-
|
You can check out https://github.com/tiangolo/sqlmodel/blob/main/sqlmodel/main.py#L372 to see exactly what's going on. To workaround this issue, I have a fork (which is what we use) that lets you customize the type in a few ways, this is one of them: https://github.com/tasn/sqlmodel/blob/fixes/sqlmodel/main.py#L378 Essentially what I do is create a custom string loader sqlalchemy type that instantiates the value after loading from the db (have the same for other base types), and I just force its usage here. |
Beta Was this translation helpful? Give feedback.
-
|
This is still an issue on data returned from the database, seemingly for fields that use anything other than builtins. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
The types are currently lying when loading from db. :)
Wanted Solution
They should work.
Wanted Code
Alternatives
No response
Operating System
Linux
Operating System Details
No response
SQLModel Version
0.0.4
Python Version
3.9
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions