Currently if we ended up having no compile-time conditional variation we end up creating a fake match expression so that the rest of the code can look the same. It would be nice if we could make the macro generate a simple query_as! without the whole map type indirection.
Using the conditional_query_as! macro can be useful even when there's no compile-time variability since it allows for referring to bound parameters by name rather than having to keep track and update the order of binding references manually.
Currently if we ended up having no compile-time conditional variation we end up creating a fake match expression so that the rest of the code can look the same. It would be nice if we could make the macro generate a simple
query_as!
without the whole map type indirection.Using the
conditional_query_as!
macro can be useful even when there's no compile-time variability since it allows for referring to bound parameters by name rather than having to keep track and update the order of binding references manually.https://github.com/kyrias/sqlx-conditional-queries/blob/363c9108515efcbdc3f3a1a3613850ab52dc93dc/core/src/lower.rs#L99-L100