Trait diesel::expression::ValidGrouping

source ·
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§

source

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<'a, T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for &'a T

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, T31)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, T30)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, T29)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, T28)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, T27)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, T26)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, T25)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, T24)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, T23)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

impl<T0, T1, T2, T3, T4, T5, T6, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5, T6)
where T0: ValidGrouping<__GroupByClause>, (T1, T2, T3, T4, T5, T6): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1, T2, T3, T4, T5, T6) as ValidGrouping<__GroupByClause>>::IsAggregate>,

source§

impl<T0, T1, T2, T3, T4, T5, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4, T5)
where T0: ValidGrouping<__GroupByClause>, (T1, T2, T3, T4, T5): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>::IsAggregate>,

§

type IsAggregate = <<T0 as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<(T1, T2, T3, T4, T5) as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<T0, T1, T2, T3, T4, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3, T4)
where T0: ValidGrouping<__GroupByClause>, (T1, T2, T3, T4): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>::IsAggregate>,

§

type IsAggregate = <<T0 as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<(T1, T2, T3, T4) as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<T0, T1, T2, T3, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2, T3)
where T0: ValidGrouping<__GroupByClause>, (T1, T2, T3): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1, T2, T3) as ValidGrouping<__GroupByClause>>::IsAggregate>,

§

type IsAggregate = <<T0 as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<(T1, T2, T3) as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<T0, T1, T2, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1, T2)
where T0: ValidGrouping<__GroupByClause>, (T1, T2): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1, T2) as ValidGrouping<__GroupByClause>>::IsAggregate>,

§

type IsAggregate = <<T0 as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<(T1, T2) as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<T0, T1, __GroupByClause> ValidGrouping<__GroupByClause> for (T0, T1)
where T0: ValidGrouping<__GroupByClause>, (T1,): ValidGrouping<__GroupByClause>, T0::IsAggregate: MixedAggregates<<(T1,) as ValidGrouping<__GroupByClause>>::IsAggregate>,

§

type IsAggregate = <<T0 as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<(T1,) as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<T0, __GroupByClause> ValidGrouping<__GroupByClause> for (T0,)
where T0: ValidGrouping<__GroupByClause>,

§

type IsAggregate = <T0 as ValidGrouping<__GroupByClause>>::IsAggregate

source§

impl<T: ValidGrouping<GB> + ?Sized, GB> ValidGrouping<GB> for Box<T>

Implementors§

source§

impl<'a, QS, ST, DB, GB, IsAggregate> ValidGrouping<GB> for dyn BoxableExpression<QS, DB, GB, IsAggregate, SqlType = ST> + 'a

§

type IsAggregate = IsAggregate

source§

impl<L, R, __GroupByClause> ValidGrouping<__GroupByClause> for Concat<L, R>
where L: ValidGrouping<__GroupByClause>, R: ValidGrouping<__GroupByClause>, L::IsAggregate: MixedAggregates<R::IsAggregate>,

§

type IsAggregate = <<L as ValidGrouping<__GroupByClause>>::IsAggregate as MixedAggregates<<R as ValidGrouping<__GroupByClause>>::IsAggregate>>::Output

source§

impl<Query, Value, GB> ValidGrouping<GB> for UncheckedBind<Query, Value>

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>,

source§

impl<S, C> ValidGrouping<()> for AliasedField<S, C>
where S: AliasSource, C: Column<Table = S::Target>,

source§

impl<ST, I, GB> ValidGrouping<GB> for Many<ST, I>
where ST: SingleValue, I: AsExpression<ST>, I::Expression: ValidGrouping<GB>,

Available on crate feature i-implement-a-third-party-backend-and-opt-into-breaking-changes only.
source§

impl<ST, T, GB> ValidGrouping<GB> for SqlLiteral<ST, T>

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.
§

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::IsAggregate: MixedAggregates<U::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::IsAggregate: MixedAggregates<U::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<__GroupByClause> ValidGrouping<__GroupByClause> for now

source§

impl<__GroupByClause> ValidGrouping<__GroupByClause> for today