pub enum RelatedReadScope {
Policy {
allow: &'static [ReadPolicy],
deny: &'static [ReadPolicy],
soft_delete_column: Option<&'static str>,
},
Unscoped,
}Variants§
Policy
Apply the related model’s list-slot read policy (@@allow/@@deny
on read/list) and its @@soft_delete filter inside the
subquery — exactly what find_many on that model applies, which
is also what ?include= goes through. A related row the caller
cannot read then behaves as if it did not exist: a to-one filter
(including ne and isNull) does not match it, none/every
over hidden-only children are vacuously true, and a relation sort
key reads as NULL.
An empty allow slice renders FALSE (default deny), the same as
a direct read of a model with no read rule.
Unscoped
Escape hatch: read the related table raw — no policy, no soft-delete filter. For trusted server code that deliberately wants every related row regardless of the caller. The embedded (rusqlite) backend ignores the scope either way. Generated client code (which never renders SQL) also uses it. Never use it for a filter or sort whose values a caller controls.