#[derive(UpdateModel)]
{
// Attributes available to this derive:
#[orm]
}
Expand description
Derive UpdateModel helpers for updating a table (patch-style).
ยงAttributes
Struct-level:
#[orm(table = "name")]- Specify table name (required)- One of:
#[orm(id_column = "id")]- Explicit primary key column#[orm(model = "TypePath")]- Derive primary key column from aModel#[orm(returning = "TypePath")]whereTypePath::IDexists
#[orm(returning = "TypePath")]- Enableupdate_by_id_returninghelpers (optional)- Multi-table write graphs (advanced): see
docs/design/multi-table-writes-final.md.
Field-level:
#[orm(skip_update)]- Never include this field in UPDATE#[orm(default)]- Use SQLDEFAULTfor this field#[orm(auto_now)]- UseNOW()for this field on update#[orm(column = "name")]/#[orm(table = "name")]- Override column/table mapping (optional)