#[model]Expand description
Attribute macro: adds an implicit primary key, then derives Model.
- no PK declared: injects
pub id: FieldUuidas the first field #[rango::model(pk = "bigint")]: injectsid: FieldAutoBigInt(database-generated);"int"givesFieldAutoInt,"uuid"is the default- a PK already exists (
idfield or#[field(primary_key)]): nothing is injected #[derive(Model)]is added unless the struct already has it
The default is not read from rango.toml: cargo does not track that file,
so builds would go stale when it changes.
ⓘ
#[rango::model]
struct Article { title: FieldVarchar<1, 200> }