pub struct SqlAggregateFunction {
pub name: String,
pub column: String,
pub column_lower: String,
pub alias: Option<String>,
pub distinct: bool,
pub extra_args: Vec<Value>,
pub expression: Option<Expression>,
pub order_by: Vec<OrderByExpression>,
pub filter: Option<Expression>,
pub hidden: bool,
}Expand description
Represents an aggregate function call in a SELECT list
Fields§
§name: StringFunction name (COUNT, SUM, AVG, MIN, MAX, etc.)
column: StringColumn name the function operates on (* for COUNT(*))
column_lower: StringPre-computed lowercase column name for index lookups
alias: Option<String>Alias for the result column
distinct: boolWhether DISTINCT is specified
extra_args: Vec<Value>Extra arguments (e.g., separator for STRING_AGG)
expression: Option<Expression>The expression to evaluate for each row (for SUM(val * 2), AVG(a + b), etc.) If None, use column directly; if Some, evaluate expression first
order_by: Vec<OrderByExpression>ORDER BY clause for ordered-set aggregates like STRING_AGG
filter: Option<Expression>FILTER clause condition - only accumulate rows where this is true
Whether this aggregate is hidden (only used for ORDER BY, not in SELECT)
Implementations§
Source§impl SqlAggregateFunction
impl SqlAggregateFunction
Sourcepub fn get_column_name(&self) -> String
pub fn get_column_name(&self) -> String
Get the result column name
Sourcepub fn get_expression_name(&self) -> String
pub fn get_expression_name(&self) -> String
Get the expression name (without alias) for HAVING clause matching
This returns SUM(price) even if there’s an alias like AS total
Trait Implementations§
Source§impl Clone for SqlAggregateFunction
impl Clone for SqlAggregateFunction
Source§fn clone(&self) -> SqlAggregateFunction
fn clone(&self) -> SqlAggregateFunction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more