Replies: 2 comments
-
|
For stringy types, that's now supported on master branch. See docs |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
thanks @angrynode for raising this thread, it's now released in the latest rc |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
New type enables usage of basic wrapper types and JSON support.
However, there are some cases where database columns can be better represented by structs. In addition, (de-)serializing using structs has the advantage of being able to fail early. A good example is the
FromJsonQueryResultderive, where I can kind of shift the deserialization error to sea-orm.I think it might be best explained using serde:
The
DeriveValueTypemacro behaves the same as#[serde(transparent)],Serde also has try_from. Sea-orm could first read as the respective database type and then use try_from to fallibly convert to the target type. The same applies in the reverse direction.
This can be implemented manually already, but requires 4 traits as specified in the docs, which is a lot of boilerplate.
Beta Was this translation helpful? Give feedback.
All reactions