sqlmodel 0.4.3

SQL databases in Rust, designed to be intuitive and type-safe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! The same fields compile once the `chrono`, `uuid`, and `decimal` features
//! are on.
#[derive(sqlmodel::Model)]
#[sqlmodel(table = "ledger")]
struct Ledger {
    #[sqlmodel(primary_key)]
    id: i64,
    at: chrono::NaiveDateTime,
    token: uuid::Uuid,
    total: rust_decimal::Decimal,
}

fn main() {
    let _ = <Ledger as sqlmodel::Model>::fields();
}