Skip to main content

Module model

Module model 

Source
Expand description

The schema model — the single source of truth for what a #[derive(Table)] struct means in SQL. Everything is serde-serializable because the snapshot file is this model as JSON.

Structs§

ColumnDef
EnumDef
A #[derive(DbEnum)] enum: stored as TEXT, constrained with a CHECK.
ForeignKey
RelationDef
A belongs-to relation field: #[orm(relation = fk_column)] field: Option<Target>. Traverses local_column (a foreign key on this table) to its referenced row. When the FK column is nullable the join is a LEFT JOIN and the field is None for rows with no parent.
Schema
A whole application schema: every #[derive(Table)] struct and #[derive(DbEnum)] enum found in the tables folder. Tables and enums are kept sorted by name so snapshots are deterministic regardless of file ordering.
TableDef

Enums§

DefaultValue
OnDelete
SqlType