pub struct AggSpec {
pub col: Option<String>,
pub op: AggOp,
pub alias: String,
}Expand description
One resolved aggregation, ready for SQL emission.
Fields§
§col: Option<String>Canonical column name from the schema, or None for COUNT(*).
op: AggOp§alias: StringOutput alias (JSON key). Always set after planning.
Implementations§
Source§impl AggSpec
impl AggSpec
Sourcepub fn sql_expr(&self) -> Result<String, AppError>
pub fn sql_expr(&self) -> Result<String, AppError>
Render the SQL aggregate expression for this spec, e.g. COUNT(*)
or SUM("amount"). The column name is quoted via
DatasetSchema::quote_ident.
By construction (see QueryRequest::agg_plan) every non-COUNT
op carries a resolved column and COUNT may omit one. If that
invariant is ever violated this returns AppError::Internal
rather than panicking, since the value flows onto a live HTTP path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AggSpec
impl RefUnwindSafe for AggSpec
impl Send for AggSpec
impl Sync for AggSpec
impl Unpin for AggSpec
impl UnsafeUnpin for AggSpec
impl UnwindSafe for AggSpec
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