#[derive(Model)]
{
// Attributes available to this derive:
#[model]
#[obs]
}
Expand description
The derive for the Model trait (the two share a name, so use day_persistence::Model
brings both): everything #[derive(Observable)] generates plus the schema half.
#[model(id)] marks the key; docs/persistence.md lists the field and struct options.
A persistable model: everything #[derive(Observable)] generates, plus impl day_persistence::Model: table name, column list, row↔struct mappers and the default row.
See day-persistence’s crate docs and docs/persistence.md.
#[model(id)] marks the key (it is #[obs(key)] too). Field options: column = "…",
unique, index, transient (observable, never stored), with = Codec, json. Struct
options: table = "…" (snake_cased struct name otherwise), index("a", "b") for
composites. #[obs(skip)] removes a field from both halves.