Add example of FromSql/ToSql to use structs for custom Jsonb fields #3231
naps62
started this conversation in
Show and tell
Replies: 1 comment 9 replies
-
Generally speaking I would be fine with having something like this in our documentation. I would like to clarify the following details first:
|
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was wanting to use custom structs rather than plain
serde_json::Value
columns. I'm using 2.0.0-rc0, and all I could find were some old discussions, where a) there wasn't any clear solution, and b) the proposed solutions didn't fully work with the new changes to FromSql/ToSqlSo I spent some time debugging and building my own. Would this be useful to showcase as an example in the official docs? it seemed to me that the diesel maintainers don't have the interest of adding this feature natively (which is understandable), but this question still showed up a few times
My working example:
Beta Was this translation helpful? Give feedback.
All reactions