sqlx-utils 1.1.3

Utilities for working with SQLx in a structured and efficient way, both when developing and running
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use sqlx_utils::sql_filter;

sql_filter! {
    pub struct UserFilter {
        SELECT * FROM users WHERE
        ?name LIKE String AND
        ?age >= i32
    }
}

fn main() {
    let filter = UserFilter::new();
    let _with_name = filter.name("John%");

    let filter2 = UserFilter::new().age(18);
    let _with_both = filter2.name("Jane%");
}