Skip to main content

Module model

Module model 

Source
Expand description

The Model trait and its static ModelMeta.

#[derive(Model)] generates everything here; the ORM, the migration autodetector and the query compiler read the same &'static metadata, so there is one source of truth and no runtime registration.

Structs§

FieldMeta
Static metadata of one concrete column.
IndexMeta
A named multi-column index.
ManyToManyMeta
A many-to-many relation stored in a join table.
ModelMeta
Static metadata of a model (Django Meta plus the field list).
RelationMeta
Relation carried by a foreign-key column.

Enums§

ConstraintMeta
A table-level constraint.
DbDefault
A server-side column default (used by migrations and inserts).
OnDelete
What happens to rows referencing a deleted row (Django on_delete).
RelationKind
Kind of a column-backed relation.

Traits§

Model
A database-backed model.

Functions§

read_column
Read prefix + column from row, decoding it as T.

Type Aliases§

MetaRef
Lazily resolved metadata of another model.