Skip to content

Support for query! #14

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

Open
kimbuba opened this issue Nov 7, 2023 · 4 comments
Open

Support for query! #14

kimbuba opened this issue Nov 7, 2023 · 4 comments

Comments

@kimbuba
Copy link

kimbuba commented Nov 7, 2023

Hello! Because of this i cannot use query_as! macro for non trivial queries.
Can you please provide support to query! macro as well?

@kyrias
Copy link
Owner

kyrias commented Nov 7, 2023

Hey,

I'd like to, but I'm not sure if there's any way of doing so due to how the query! macro works.

The problem is that each query! invocation results in a Map type containing a unique anonymous row type, and so far I have not been able to come up with a way of providing a reasonable interface over that without SQLx implementing some way of re-using the same row type across invocations.

@Zizico2
Copy link

Zizico2 commented Nov 27, 2023

Is there a way to use conditional_query_as! without returned values? I can't seem to find a way to make it work. Even with a struct Empty; as the row type.

@Zizico2
Copy link

Zizico2 commented Nov 27, 2023

This workaround works with sqlx's query_as!

@kyrias
Copy link
Owner

kyrias commented Jan 19, 2024

Could you attach a minimal reproducible example of something that works with query_as! but not with conditional_query_as!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants