pub struct Aggregate<'outer, 'inner, S> { /* private fields */ }Expand description
This is the argument type used for aggregate.
Implementations§
Source§impl<'outer, 'inner, S: 'static> Aggregate<'outer, 'inner, S>
impl<'outer, 'inner, S: 'static> Aggregate<'outer, 'inner, S>
Sourcepub fn avg(
&self,
val: impl IntoExpr<'inner, S, Typ = f64>,
) -> Expr<'outer, S, Option<f64>>
pub fn avg( &self, val: impl IntoExpr<'inner, S, Typ = f64>, ) -> Expr<'outer, S, Option<f64>>
Return the average value in a column, this is None if there are zero rows.
Sourcepub fn max<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, Option<T>>where
T: NumTyp,
pub fn max<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, Option<T>>where
T: NumTyp,
Return the maximum value in a column, this is None if there are zero rows.
Sourcepub fn min<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, Option<T>>where
T: NumTyp,
pub fn min<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, Option<T>>where
T: NumTyp,
Return the minimum value in a column, this is None if there are zero rows.
Sourcepub fn sum<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, T>where
T: NumTyp,
pub fn sum<T>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, T>where
T: NumTyp,
Return the sum of a column.
Sourcepub fn count_distinct<T: EqTyp + 'static>(
&self,
val: impl IntoExpr<'inner, S, Typ = T>,
) -> Expr<'outer, S, i64>
pub fn count_distinct<T: EqTyp + 'static>( &self, val: impl IntoExpr<'inner, S, Typ = T>, ) -> Expr<'outer, S, i64>
Return the number of distinct values in a column.
Methods from Deref<Target = Rows<'inner, S>>§
Sourcepub fn join<T: Table<Schema = S>>(
&mut self,
j: impl Joinable<'inner, Typ = T>,
) -> Expr<'inner, S, T>
pub fn join<T: Table<Schema = S>>( &mut self, j: impl Joinable<'inner, Typ = T>, ) -> Expr<'inner, S, T>
Join a table, this is like a super simple Iterator::flat_map but for queries.
After this operation Rows has rows for the combinations of each original row with each row of the table. (Also called the “Carthesian product”)
The expression that is returned refers to the joined table.
Trait Implementations§
Auto Trait Implementations§
impl<'outer, 'inner, S> Freeze for Aggregate<'outer, 'inner, S>
impl<'outer, 'inner, S> !RefUnwindSafe for Aggregate<'outer, 'inner, S>
impl<'outer, 'inner, S> !Send for Aggregate<'outer, 'inner, S>
impl<'outer, 'inner, S> !Sync for Aggregate<'outer, 'inner, S>
impl<'outer, 'inner, S> Unpin for Aggregate<'outer, 'inner, S>where
S: Unpin,
impl<'outer, 'inner, S> !UnwindSafe for Aggregate<'outer, 'inner, S>
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