prax-orm 0.8.0

A next-generation, type-safe ORM for Rust inspired by Prisma
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use prax::Model;

#[derive(Model)]
#[prax(table = "events")]
struct Event {
    #[prax(id)]
    id: i32,
    when: chrono::NaiveDate,
}

fn main() {
    // If classify_field_type saw chrono::NaiveDate as Numeric,
    // event::when::gt would be generated.
    let _ = event::when::gt(chrono::NaiveDate::from_ymd_opt(2020, 1, 1).unwrap());
}