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§
- Column
Def - EnumDef
- A
#[derive(DbEnum)]enum: stored as TEXT, constrained with a CHECK. - Foreign
Key - Relation
Def - A belongs-to relation field:
#[orm(relation = fk_column)] field: Option<Target>. Traverseslocal_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 isNonefor 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. - Table
Def