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 at the Vista layer (Vista::with_foreign), not here. Typed Table<T, E> is single-backend by construction.

Re-exports§

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

Modules§

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.