sql-orm 0.1.0

Public API crate for the sql-orm workspace.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use sql_orm::prelude::*;

#[derive(Entity, Debug, Clone)]
#[orm(table = "clients", schema = "sales", renamed_from = "customers")]
pub struct Client {
    #[orm(primary_key)]
    #[orm(identity)]
    pub id: i64,

    pub email: String,
}

fn main() {
    let metadata = Client::metadata();

    assert_eq!(metadata.table, "clients");
    assert_eq!(metadata.renamed_from, Some("customers"));
}