-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Document how to use Json<T>
with the query macros
#3153
Comments
Not a bug. The query macros map JSON columns to See this example (uses Note also that Leaving this open as a documentation issue. |
Json<T>
with the query macros
It is indeed working as intended when the types are set in the request. |
Hey there, would be open to take this on. @ElysaSrc, where would you have wished to find the hint regarding the need to use the |
I just ran into this myself. It would be nice if the docs for the |
@dyc3 I took a shot at writing down what you recommended. Is it helpful? |
Yes! That's exactly what I was looking for. |
#3447 would have been what I was looking for too! Thanks, sorry for the delay to respond. |
Thanks for the Feedback! I will fix the doctests when I get home today so that the PR is mergeable. |
Bug Description
The Json support for postgresql only works through the usage of the Value type. The Json type when used as show in the documentation doesn't work : https://docs.rs/sqlx/latest/sqlx/types/struct.Json.html
I've checked the source and I have the feeling that the Json module is not covered by tests, it may have been broken in one refactoring.
Minimal Reproduction
I've made a minimal repo that repro the compiler error.
https://github.com/ElysaSrc/repro-sqlx-json-bug
Info
["runtime-tokio","tls-rustls","postgres","chrono","migrate","uuid","json"]
rustc --version
: rustc 1.77.0 (aedd173a2 2024-03-17)The text was updated successfully, but these errors were encountered: