Default Serialization Functions¶
See also
SQLAthanor applies default serialization functions to pre-process your model attributes before serializing them. These default functions primarily exist to convert a SQLAlchemy Data Type into a type appropriate for the format to which you are serializing your model instance.
The table below explains how a given model attribute data type is serialized using the default serialization function for each data type. If no information is provided, that means the value is serialized “as-is”.
Data Types | CSV | JSON | YAML | dict |
---|---|---|---|---|
None |
Empty string
'' |
|||
bool
Boolean
BOOLEAN |
||||
ISO-8601
formatted
string
|
ISO-8601
formatted
string
|
ISO-8601
formatted
string
|
||
bytes |
string | string | string | |
INTERVAL |
total number
of seconds
|
total number
of seconds
|
total number
of seconds
|
|
string | ||||
oracle.BFILE
oracle.RAW |
string | string | ||
string | string | string | ||
UnsupportedSerializationError |
||||
UnsupportedSerializationError |
list | list | ||
UnsupportedSerializationError |
UnsupportedSerializationError |
UnsupportedSerializationError |
UnsupportedSerializationError |