How to use Pickle Type #1484
-
First Check
Commit to Help
Example Codefrom sqlmodel import SQLModel, Field, PickleType
class FlowInDb(SQLModel, table=True):
id : str = Field(primary_key=True)
flow: PickleType
class Config:
arbitrary_types_allowed = TrueDescriptionGetting Error ... Operating SystemWindows Operating System DetailsNo response SQLModel Version0.06 Python Version3.10 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
Try |
Beta Was this translation helpful? Give feedback.
-
Thanks Gettting ... sqlalchemy.exc.IntegrityError: (sqlite3.IntegrityError) NOT NULL constraint failed: flowindb.flow |
Beta Was this translation helpful? Give feedback.
-
|
My previous answer was perhaps a bit confusing. Suppose Then you can insert a You don't have to pickle yourself, PickleType takes care of that. |
Beta Was this translation helpful? Give feedback.
My previous answer was perhaps a bit confusing. Suppose
flowis of typeFoo, then your code becomes:Then you can insert a
FlowInDbinstance into the database like this:You don't have to pickle yourself, PickleType takes care of that.