Skip to main content

Crate ignis_derive

Crate ignis_derive 

Source
Expand description

Ignis-DB Procedural Macros

This crate provides clean derive macros for the Ignis-DB ORM:

  • #[derive(IgnisModel)] - Automatic trait implementation
  • #[derive(Insertable)] - Safe insert operations
  • #[derive(Updatable)] - Safe update operations
  • #[derive(Deletable)] - Safe delete operations
  • #[derive(PgComposite)] - PostgreSQL composite type support

Usage:

ⓘ
#[derive(IgnisModel, Insertable, Updatable, Deletable)]
#[ignis(table = "users", pk = "id")]
pub struct User {
    pub id: i32,
    pub name: String,
    pub email: String,
    pub address: Address, // Composite type
}

#[derive(PgComposite)]
#[pg_composite(name = "address")]
pub struct Address {
    pub street: String,
    pub city: String,
    pub zipcode: Option<String>,
}

Derive Macros§

Deletable
Derive macro for Deletable trait
IgnisModel
Derive macro for IgnisModel trait
Insertable
Derive macro for Insertable trait
PgComposite
Derive macro for PostgreSQL composite types
Updatable
Derive macro for Updatable trait