Skip to main content

Module loading

Module loading 

Source
Expand description

Batched relation loading.

Each relation costs exactly one query regardless of how many parents were fetched — the whole point of eager loading. Called by the code #[luxid::model] generates rather than by hand.

Functions§

load_belongs_to
The inverse: the parent holds the foreign key.
load_has_many
One parent, many children: SELECT * FROM children WHERE fk IN (parent ids).
load_has_one
One parent, one child, keyed the same way but yielding a single value.