Skip to main content

Module relations

Module relations 

Source
Expand description

Relation Intelligence Layer — runtime registry.

The admin renders, filters, and guards deletes on foreign keys by consulting a RelationRegistry built pure-functionally from the current [AdminEntry] list. The registry itself is data; it does no I/O and holds no connections.

Tier 1 supports only BelongsTo relations (declared via #[rustio(belongs_to = "Target")] on the struct field). The legacy schema-driven variant (built from crate::schema::Schema) has been replaced with the AdminEntry-driven build below — Tier 1 has no separate schema layer.

§Two lookup tables, computed once per Admin reload

  • belongs_to[(model, field)] → ResolvedRelation — forward direction.
  • has_many[model] → Vec<InverseRelation> — every incoming edge into model, used by the inverse-panel renderer and the delete guard.

Structs§

InverseRelation
One reverse (HasMany) relation — an incoming edge pointing at a given target model. Produced by inverting every stored BelongsTo at registry-build time.
RelationRegistry
Relation lookup tables for one snapshot of the admin registration.
ResolvedRelation
One forward (BelongsTo) relation resolved against the current admin registration.

Enums§

RegistryError
Why a RelationRegistry declaration was rejected.

Constants§

RELATION_FILTER_DROPDOWN_CAP
Soft cap on the number of rows a relation filter will expose as a <select> dropdown. Above this threshold the admin renders a numeric-id input instead. 500 was chosen to fit comfortably in one HTTP round-trip.