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.
|
// TODO: Think about whether we just return earlier in the pipeline and just return the |
|
// original macro input as a `query_as!` macro. |
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.sqlx-conditional-queries/core/src/lower.rs
Lines 99 to 100 in 363c910