sqlx_insert 0.2.0

Proc macro for generating insert statements for sqlx
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use sqlx_insert::SQLInsert;
use sqlx::Postgres;

#[derive(SQLInsert, Clone, Debug)]
#[sqlx_insert(database(Postgres))]
pub struct Thing {
    id: String,
    amount: i32,
    complex: ComplexType, // Type cannot be inserted and is not ignored
}

#[derive(Debug, Clone)]
struct ComplexType {
    a: String,
}

fn main() {}