Crate ormx[][src]

Expand description

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

Example: Table

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

Example: Patch

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


See the docs of derive(Table) and Patch.


An improved version of sqlx::query_as!.


A type which can be inserted as a row into the database.

A type which can be used to “patch” a row, updating multiple fields at once.

A database table in which each row is identified by a unique ID.

Type Definitions

Derive Macros

Derives Patch.

Derives Table and generates a struct for inserting rows and accessors to certain fields.