pub enum AliasAggregator {
Count,
Sum {
field: String,
},
Avg {
field: String,
},
Min {
field: String,
},
Max {
field: String,
},
GroupBy {
by_field: String,
having: Option<ListFilter>,
inner: Option<Box<AliasAggregator>>,
},
}Expand description
Aggregator primitive selected by the caller of query_aggregate.
Variants§
Count
COUNT(*) over the source rows.
Sum
SUM(json_extract(data, '$.<field>')).
Avg
AVG(json_extract(data, '$.<field>')).
Min
MIN(json_extract(data, '$.<field>')).
Max
MAX(json_extract(data, '$.<field>')).
GroupBy
GROUP BY <by_field> with an optional per-group inner aggregator
and an optional HAVING predicate.
having is emitted as a HAVING clause after GROUP BY
(Crux #2). inner is an optional scalar sub-aggregator
(Sum / Avg / Min / Max); nested GroupBy is rejected at
validation time in Phase 1.
Implementations§
Source§impl AliasAggregator
impl AliasAggregator
Sourcepub fn validate(&self, schema: &SchemaConfig) -> Result<(), MiniAppError>
pub fn validate(&self, schema: &SchemaConfig) -> Result<(), MiniAppError>
Verify that every field / by_field referenced by this aggregator
is declared in schema, and recursively validate inner + having.
Trait Implementations§
Source§impl Clone for AliasAggregator
impl Clone for AliasAggregator
Source§fn clone(&self) -> AliasAggregator
fn clone(&self) -> AliasAggregator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AliasAggregator
impl Debug for AliasAggregator
Source§impl<'de> Deserialize<'de> for AliasAggregator
impl<'de> Deserialize<'de> for AliasAggregator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for AliasAggregator
impl JsonSchema for AliasAggregator
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for AliasAggregator
impl RefUnwindSafe for AliasAggregator
impl Send for AliasAggregator
impl Sync for AliasAggregator
impl Unpin for AliasAggregator
impl UnsafeUnpin for AliasAggregator
impl UnwindSafe for AliasAggregator
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