-
Notifications
You must be signed in to change notification settings - Fork 1.4k
#[derive(flatten)] doesn't work with query_as! macro #2188
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
Comments
The I thought I remembered seeing that mentioned in the docs somewhere, but I can't find it now |
Poked around some more and found that this is detailed in the docs for
Along with providing a lot more details as to why (in short this allows for enforcing more checks at compile time) |
I see, thanks for replying. I love the compile-time checks sqlx does, and I hoped it was just an oversight/bug that it could not be used with |
Long-standing feature request: #514 Closing as duplicate. |
How did you avoid this problem? I'm facing the same issue |
Bug Description
#[derive(flatten)]
doesn't work with thequery_as!
macro. It fails to compile. The example code in the provided github repo does compile when thesqlx::query_as
function is used.Minimal Reproduction
repo: https://github.com/miquels/sqlx-flatten-fails-with-query_as-macro
code is in
src/main.rs
reproduce: just do
cargo run
Info
rustc --version
: rustc 1.64.0 (a55dd71d5 2022-09-19)The text was updated successfully, but these errors were encountered: