sqlx_conditional_queries_layering
This library provides a macro for handling query templates in conjunction with the sqlx_conditional_queries
library. It simplifies the creation of SQL queries with conditional parameters.
Basic Example
let keehee =
.choose
.cloned
.unwrap_or_default;
create_conditional_query_as!;
This will generate two macros: _keehee_query
and feed_keehee_query
.
Using Generated Macros
_keehee_query
is a template. You can use it to do an sqlx query:
keehee_query!
.fetch_one
.await;
feed_YOUR_QUERY_NAME
is used to add more conditional queries to an existing template:
feed_query_keehee_query!;
This will generate a macro for keehee_query
with the additional #oi
argument. You can continue adding more arguments recursively.
Note
This macro relies on other macros from sqlx_conditional_queries
.