Skip to main content

GroupedQuery

Struct GroupedQuery 

Source
pub struct GroupedQuery<R> { /* private fields */ }
Expand description

A query grouped by columns, waiting for the aggregate that reduces each group (GroupedQuery in packages/zql/src/query/query.ts): one GroupRow per group.

Implementations§

Source§

impl<R> GroupedQuery<R>

Source

pub fn any(&self) -> &AnyGroupedQuery

The untyped grouped query this one wraps.

Source

pub fn count(self) -> Grouped<R, i64>

Each group’s row count.

Source

pub fn sum<V: NumericZeroValue>( self, column: Column<R, V>, ) -> Grouped<R, Option<f64>>

Each group’s sum of column.

Source

pub fn sum_json<V>( self, column: Column<R, V>, path: Vec<JsonPathSegment>, ) -> Grouped<R, Option<f64>>

Each group’s sum of the numbers at path in the JSON column.

Source

pub fn avg<V: NumericZeroValue>( self, column: Column<R, V>, ) -> Grouped<R, Option<f64>>

Each group’s average of column.

Source

pub fn avg_json<V>( self, column: Column<R, V>, path: Vec<JsonPathSegment>, ) -> Grouped<R, Option<f64>>

Each group’s average of the numbers at path in the JSON column.

Source

pub fn min<V: OrderedZeroValue>( self, column: Column<R, V>, ) -> Grouped<R, Option<V::Unwrapped>>

Each group’s least value of column.

Source

pub fn min_json<V>( self, column: Column<R, V>, path: Vec<JsonPathSegment>, ) -> Grouped<R, Option<Value>>

Each group’s least value at path in the JSON column.

Source

pub fn max<V: OrderedZeroValue>( self, column: Column<R, V>, ) -> Grouped<R, Option<V::Unwrapped>>

Each group’s greatest value of column.

Source

pub fn max_json<V>( self, column: Column<R, V>, path: Vec<JsonPathSegment>, ) -> Grouped<R, Option<Value>>

Each group’s greatest value at path in the JSON column.

Auto Trait Implementations§

§

impl<R> Forget for GroupedQuery<R>

§

impl<R> Freeze for GroupedQuery<R>
where PhantomData<fn() -> R>: Freeze,

§

impl<R> Move for GroupedQuery<R>

§

impl<R> RefUnwindSafe for GroupedQuery<R>
where PhantomData<fn() -> R>: RefUnwindSafe,

§

impl<R> Send for GroupedQuery<R>
where PhantomData<fn() -> R>: Send,

§

impl<R> Sync for GroupedQuery<R>
where PhantomData<fn() -> R>: Sync,

§

impl<R> Unpin for GroupedQuery<R>
where PhantomData<fn() -> R>: Unpin,

§

impl<R> UnsafeUnpin for GroupedQuery<R>
where PhantomData<fn() -> R>: UnsafeUnpin,

§

impl<R> UnwindSafe for GroupedQuery<R>
where PhantomData<fn() -> R>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.