pub trait QueryBuilderWithMethods<M> {
// Required methods
fn with(self, relation: &str) -> QueryBuilderWithEagerLoading<M>;
fn with_where<F>(
self,
relation: &str,
constraint: F,
) -> QueryBuilderWithEagerLoading<M>
where F: FnOnce(RelationshipConstraintBuilder) -> RelationshipConstraintBuilder + 'static;
fn with_when(
self,
condition: bool,
relation: &str,
) -> QueryBuilderWithEagerLoading<M>;
fn with_count(self, relation: &str) -> QueryBuilderWithEagerLoading<M>;
fn with_count_where<F>(
self,
alias: &str,
relation: &str,
constraint: F,
) -> QueryBuilderWithEagerLoading<M>
where F: FnOnce(RelationshipConstraintBuilder) -> RelationshipConstraintBuilder + 'static;
}Expand description
Extension trait for QueryBuilder to add eager loading support
Required Methods§
Sourcefn with(self, relation: &str) -> QueryBuilderWithEagerLoading<M>
fn with(self, relation: &str) -> QueryBuilderWithEagerLoading<M>
Add a relationship to eagerly load
Sourcefn with_where<F>(
self,
relation: &str,
constraint: F,
) -> QueryBuilderWithEagerLoading<M>
fn with_where<F>( self, relation: &str, constraint: F, ) -> QueryBuilderWithEagerLoading<M>
Add a relationship with constraints
Sourcefn with_when(
self,
condition: bool,
relation: &str,
) -> QueryBuilderWithEagerLoading<M>
fn with_when( self, condition: bool, relation: &str, ) -> QueryBuilderWithEagerLoading<M>
Add conditional eager loading
Sourcefn with_count(self, relation: &str) -> QueryBuilderWithEagerLoading<M>
fn with_count(self, relation: &str) -> QueryBuilderWithEagerLoading<M>
Load relationship counts without loading the relationships
Sourcefn with_count_where<F>(
self,
alias: &str,
relation: &str,
constraint: F,
) -> QueryBuilderWithEagerLoading<M>
fn with_count_where<F>( self, alias: &str, relation: &str, constraint: F, ) -> QueryBuilderWithEagerLoading<M>
Load relationship counts with constraints
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<M> QueryBuilderWithMethods<M> for QueryBuilder<M>
Implementation for base QueryBuilder to support eager loading