23 releases

0.11.0 Sep 8, 2024
0.10.0 Sep 24, 2021
0.9.0 Sep 23, 2021
0.7.0 Mar 29, 2021
0.2.0 Nov 19, 2020

#2450 in Database interfaces

Download history 10/week @ 2025-02-08 6/week @ 2025-02-15 15/week @ 2025-02-22 8/week @ 2025-03-01 9/week @ 2025-03-08 14/week @ 2025-03-15 9/week @ 2025-03-22 2/week @ 2025-03-29 3/week @ 2025-04-05 1/week @ 2025-04-12 6/week @ 2025-04-19 10/week @ 2025-04-26 21/week @ 2025-05-03 33/week @ 2025-05-10 10/week @ 2025-05-17

64 downloads per month

MIT license

31KB
693 lines

ormx

please take a look at the repository and the documentation


lib.rs:

Lightweight derive macros for bringing orm-like features to sqlx.

Example: Table

#[derive(ormx::Table)]
#[ormx(table = "users", id = user_id, insertable)]
struct User {
    #[ormx(column = "id")]
    user_id: u32,
    first_name: String,
    last_name: String,
    #[ormx(get_optional(&str))]
    email: String,
    #[ormx(default, set)]
    last_login: Option<NaiveDateTime>,
}

Example: Patch

#[derive(ormx::Patch)]
#[ormx(table_name = "users", table = User, id = "id")]
struct UpdateName {
    first_name: String,
    last_name: String,
}

Documentation

See the docs of derive(Table) and Patch.

Dependencies

~8–21MB
~292K SLoC