Open stevenliebregt opened 1 year ago
I think I may have found the issue, a serde_json::Value
containing a number encodes as b"5"
, while a i32
encodes as b"\0\0\0\x05"
. So I guess I'll have to do a nice match
statement to cast data before encoding it
I'm trying to implement a type that has a
data
field of typeserde_json::Value
which should be an object, that can be inserted into any composite type so long as the name and fields match.So if for example I have a composite type
An instance of
CompositeType
like the following should be allowed to be inserted there:Now I took the generated
ToSql
implementation of the derive macro that normally should work for a struct with named fields and tried to adapt it, but it keeps giving the error:db error: ERROR: insufficient data left in message
, and I'm not sure what the problem is.The
ToSql
implementation is as follows: