Skip to main content

Module references

Module references 

Source
Expand description

Table reference system for relationships between tables.

The Reference trait describes a relationship (field names, target factory). Same-persistence resolution happens in Table::get_ref_from_row via Reference::resolve_from_row — the join value is read out of a known source row and pushed as a plain eq-condition on the target.

Two concrete types:

  • HasOne — foreign key on source table (e.g. Client.bakery_id → Bakery)
  • HasMany — foreign key on target table (e.g. Bakery → Client.bakery_id)

Cross-persistence references live in vantage-vista-factory’s VistaCatalog, not here. Typed Table<T, E> is single-backend by construction.

Re-exports§

pub use contained::ContainedRelation;
pub use many::HasMany;
pub use one::HasOne;

Modules§

contained
Contained relation registration — a closure that builds the embedded record’s table, mirroring how HasOne / HasMany carry a build_target for joined tables.
many
HasMany — one-to-many relationship where the foreign key is on the target table.
one
HasOne — one-to-one relationship where the foreign key is on the source table.

Traits§

Reference
Describes a relationship between two tables.