pub struct RelationLoader<E: QueryEngine> { /* private fields */ }Expand description
Relation loader for executing relation queries.
Implementations§
Source§impl<E: QueryEngine> RelationLoader<E>
impl<E: QueryEngine> RelationLoader<E>
Sourcepub fn with_strategy(self, strategy: RelationLoadStrategy) -> Self
pub fn with_strategy(self, strategy: RelationLoadStrategy) -> Self
Set the loading strategy.
Sourcepub fn with_batch_size(self, size: usize) -> Self
pub fn with_batch_size(self, size: usize) -> Self
Set the batch size for separate queries.
Sourcepub fn build_one_to_many_query(
&self,
spec: &RelationSpec,
include: &IncludeSpec,
parent_ids: &[FilterValue],
) -> (String, Vec<FilterValue>)
pub fn build_one_to_many_query( &self, spec: &RelationSpec, include: &IncludeSpec, parent_ids: &[FilterValue], ) -> (String, Vec<FilterValue>)
Build a query for loading a one-to-many relation.
Sourcepub fn build_many_to_one_query(
&self,
spec: &RelationSpec,
child_foreign_keys: &[FilterValue],
) -> (String, Vec<FilterValue>)
pub fn build_many_to_one_query( &self, spec: &RelationSpec, child_foreign_keys: &[FilterValue], ) -> (String, Vec<FilterValue>)
Build a query for loading a many-to-one relation.
Sourcepub fn build_many_to_many_query(
&self,
spec: &RelationSpec,
include: &IncludeSpec,
parent_ids: &[FilterValue],
) -> (String, Vec<FilterValue>)
pub fn build_many_to_many_query( &self, spec: &RelationSpec, include: &IncludeSpec, parent_ids: &[FilterValue], ) -> (String, Vec<FilterValue>)
Build a query for loading a many-to-many relation.
Trait Implementations§
Source§impl<E: QueryEngine + Clone> Clone for RelationLoader<E>
impl<E: QueryEngine + Clone> Clone for RelationLoader<E>
Auto Trait Implementations§
impl<E> Freeze for RelationLoader<E>where
E: Freeze,
impl<E> RefUnwindSafe for RelationLoader<E>where
E: RefUnwindSafe,
impl<E> Send for RelationLoader<E>
impl<E> Sync for RelationLoader<E>
impl<E> Unpin for RelationLoader<E>where
E: Unpin,
impl<E> UnwindSafe for RelationLoader<E>where
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more