Skip to main content

DeriveEntityModel

Derive Macro DeriveEntityModel 

Source
#[derive(DeriveEntityModel)]
{
    // Attributes available to this derive:
    #[turso]
}
Available on crate feature macros only.
Expand description

Derives an entity from a Model struct.

Generates Entity, Column, PrimaryKey and ActiveModel next to the model. Field attributes: #[turso(primary_key)], #[turso(auto_increment = false)], #[turso(column_name = "...")], #[turso(unique)], #[turso(indexed)], #[turso(default_value = ...)], #[turso(ignore)]. Struct attribute: #[turso(table_name = "...")].