-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Support For Decoding To Vec<T> For JSON Columns #1834
Conversation
…ait For Enums And JSON Array SeaQL#1517
@@ -396,14 +432,14 @@ mod tests { | |||
} | |||
|
|||
test_num_value_uint!(U8, "u8", "TinyInteger", TinyInteger); | |||
test_num_value_uint!(U16, "u16", "SmallInteger", SmallInteger); | |||
// test_num_value_uint!(U16, "u16", "SmallInteger", SmallInteger); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyt2y3 @billy1624 Can you please help me out with this one? I wrecked my brain a lot already but couldn't figure it out.
- I'm note sure why these use the Integer defs and not Unsigned defs (
TinyInteger
instead ofTinyUnsigned
for example. - I just cannot figure out why these tests worked before, given that
u16
doesn't implement sqlx'sDecode
trait andu64
doesn't implement sqlx'sPgHasArray
trait, so I cannot add a manualTryGetable
implementation for either of them.
Thank you for the effort! I also need some time to wrap my head around it. |
Thanks again for your effort. I am glad to see a proof of concept here. Having seen this, I got a slightly different idea, so please let me try on it. |
Thanks @tyt2y3, Reworked changes look so much better :D |
Closing in favour of #1898 |
PR Info
New Features
Changes
ActiveEnumOfJson
trait that is implemented byActiveEnum
andJSON
types.TryGetable
for anyT
whereT
implementsActiveEnumOfJson
.TryGetable
for anyVec<T>
whereT
implementsActiveEnumOfJson
, when array feature is enabled.FromJsonQueryResult
macro to implement theNotU8
trait for the target struct/enum whenpostgres-arrays
feature is enabled.DeriveActiveEnum
macro to implementActiveEnumOfJson
for ActiveEnums.ActiveEnumOfJson
implementation for JSON type.