pub trait ValidGrouping<GroupByClause> {
type IsAggregate;
}Expand description
Is this expression valid for a given group by clause?
Implementations of this trait must ensure that aggregate expressions are not mixed with non-aggregate expressions.
For generic types, you can determine if your sub-expressions can appear
together using the MixedAggregates trait.
GroupByClause will be a tuple containing the set of expressions appearing
in the GROUP BY portion of the query. If there is no GROUP BY, it will
be ().
This trait can be derived
Required Associated Types§
Sourcetype IsAggregate
type IsAggregate
Is this expression aggregate?
This type should always be one of the structs in the is_aggregate
module. See the documentation of those structs for more details.
Implementations on Foreign Types§
Source§impl<GB> ValidGrouping<GB> for ()
impl<GB> ValidGrouping<GB> for ()
type IsAggregate = Never
Source§impl<T, __GroupByClause> ValidGrouping<__GroupByClause> for (T₁, T₂, …, Tₙ)where
T: ValidGrouping<__GroupByClause>,
impl<T, __GroupByClause> ValidGrouping<__GroupByClause> for (T₁, T₂, …, Tₙ)where
T: ValidGrouping<__GroupByClause>,
type IsAggregate = <T as ValidGrouping<__GroupByClause>>::IsAggregate
Source§impl<T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for &T
impl<T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for &T
type IsAggregate = <T as ValidGrouping<GB>>::IsAggregate
Source§impl<T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for Box<T>
impl<T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for Box<T>
type IsAggregate = <T as ValidGrouping<GB>>::IsAggregate
Implementors§
Source§impl<L, R, __GroupByClause> ValidGrouping<__GroupByClause> for Concat<L, R>where
L: ValidGrouping<__GroupByClause>,
R: ValidGrouping<__GroupByClause>,
<L as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<R as ValidGrouping<__GroupByClause>>::IsAggregate>,
impl<L, R, __GroupByClause> ValidGrouping<__GroupByClause> for Concat<L, R>where
L: ValidGrouping<__GroupByClause>,
R: ValidGrouping<__GroupByClause>,
<L as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<R as ValidGrouping<__GroupByClause>>::IsAggregate>,
type IsAggregate = <<L as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<R as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
Source§impl<QS, ST, DB, GB, IsAggregate> ValidGrouping<GB> for dyn BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + '_
impl<QS, ST, DB, GB, IsAggregate> ValidGrouping<GB> for dyn BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + '_
type IsAggregate = IsAggregate
Source§impl<Query, Value, GB> ValidGrouping<GB> for UncheckedBind<Query, Value>
impl<Query, Value, GB> ValidGrouping<GB> for UncheckedBind<Query, Value>
type IsAggregate = Never
Source§impl<S, C1, C2> ValidGrouping<AliasedField<S, C1>> for AliasedField<S, C2>where
S: AliasSource,
C1: Column<Table = S::Target>,
C2: Column<Table = S::Target> + ValidGrouping<C1, IsAggregate = Yes>,
impl<S, C1, C2> ValidGrouping<AliasedField<S, C1>> for AliasedField<S, C2>where
S: AliasSource,
C1: Column<Table = S::Target>,
C2: Column<Table = S::Target> + ValidGrouping<C1, IsAggregate = Yes>,
type IsAggregate = Yes
Source§impl<S, C> ValidGrouping<()> for AliasedField<S, C>
impl<S, C> ValidGrouping<()> for AliasedField<S, C>
type IsAggregate = No
Source§impl<ST, I, GB> ValidGrouping<GB> for Many<ST, I>
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
impl<ST, I, GB> ValidGrouping<GB> for Many<ST, I>
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.type IsAggregate = <<I as AsExpression<ST>>::Expression as ValidGrouping<GB>>::IsAggregate
Source§impl<ST, T, GB> ValidGrouping<GB> for SqlLiteral<ST, T>
impl<ST, T, GB> ValidGrouping<GB> for SqlLiteral<ST, T>
type IsAggregate = Never
Source§impl<T, GB> ValidGrouping<GB> for Exists<T>where
Subselect<T, Bool>: ValidGrouping<GB>,
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
impl<T, GB> ValidGrouping<GB> for Exists<T>where
Subselect<T, Bool>: ValidGrouping<GB>,
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.type IsAggregate = <Subselect<T, Bool> as ValidGrouping<GB>>::IsAggregate
Source§impl<T, U, __GroupByClause> ValidGrouping<__GroupByClause> for In<T, U>where
T: ValidGrouping<__GroupByClause>,
U: ValidGrouping<__GroupByClause>,
<T as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<U as ValidGrouping<__GroupByClause>>::IsAggregate>,
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
impl<T, U, __GroupByClause> ValidGrouping<__GroupByClause> for In<T, U>where
T: ValidGrouping<__GroupByClause>,
U: ValidGrouping<__GroupByClause>,
<T as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<U as ValidGrouping<__GroupByClause>>::IsAggregate>,
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.type IsAggregate = <<T as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<U as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output
Source§impl<T, U, __GroupByClause> ValidGrouping<__GroupByClause> for NotIn<T, U>where
T: ValidGrouping<__GroupByClause>,
U: ValidGrouping<__GroupByClause>,
<T as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<U as ValidGrouping<__GroupByClause>>::IsAggregate>,
Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
impl<T, U, __GroupByClause> ValidGrouping<__GroupByClause> for NotIn<T, U>where
T: ValidGrouping<__GroupByClause>,
U: ValidGrouping<__GroupByClause>,
<T as ValidGrouping<__GroupByClause>>::IsAggregate: MixedAggregates<<U as ValidGrouping<__GroupByClause>>::IsAggregate>,
Available on crate feature
i-implement-a-third-party-backend-and-opt-into-breaking-changes only.