pub struct ParsedSelect {Show 17 fields
pub table: String,
pub joins: Vec<ParsedJoin>,
pub columns: Option<Vec<ColumnName>>,
pub column_aliases: Option<Vec<Option<String>>>,
pub case_columns: Vec<ComputedColumn>,
pub predicates: Vec<Predicate>,
pub order_by: Vec<OrderByClause>,
pub limit: Option<LimitExpr>,
pub offset: Option<LimitExpr>,
pub aggregates: Vec<AggregateFunction>,
pub aggregate_filters: Vec<Option<Vec<Predicate>>>,
pub group_by: Vec<ColumnName>,
pub distinct: bool,
pub having: Vec<HavingCondition>,
pub ctes: Vec<ParsedCte>,
pub window_fns: Vec<ParsedWindowFn>,
pub scalar_projections: Vec<ParsedScalarProjection>,
}Expand description
Parsed SELECT statement.
Fields§
§table: StringTable name from FROM clause.
joins: Vec<ParsedJoin>JOIN clauses.
columns: Option<Vec<ColumnName>>Selected columns (None = SELECT *).
column_aliases: Option<Vec<Option<String>>>Optional alias per selected column (parallel with columns when
columns is Some). None entries mean the column was not
aliased; the output column name uses the source column name.
ROADMAP v0.5.0 item A — SELECT alias preservation. Prior to
v0.5.0 aliases were discarded at parse time, breaking every UI
app that used SELECT col AS new_name.
case_columns: Vec<ComputedColumn>CASE WHEN computed columns from the SELECT clause.
predicates: Vec<Predicate>WHERE predicates.
order_by: Vec<OrderByClause>ORDER BY clauses.
limit: Option<LimitExpr>LIMIT value (literal or $N parameter).
offset: Option<LimitExpr>OFFSET value (literal or $N parameter). Resolved alongside limit.
aggregates: Vec<AggregateFunction>Aggregate functions in SELECT clause.
aggregate_filters: Vec<Option<Vec<Predicate>>>Per-aggregate FILTER (WHERE ...) predicates.
Parallel with aggregates (same length). None means no filter.
Evaluated against each input row during accumulation; only rows
matching the filter contribute to that aggregate. Common in clinical
dashboards: COUNT(*) FILTER (WHERE status = 'abnormal').
group_by: Vec<ColumnName>GROUP BY columns.
distinct: boolWhether DISTINCT is specified.
having: Vec<HavingCondition>HAVING predicates (applied after GROUP BY aggregation).
ctes: Vec<ParsedCte>Common Table Expressions (CTEs) from WITH clause.
window_fns: Vec<ParsedWindowFn>AUDIT-2026-04 S3.2 — window functions in SELECT clause.
Applied as a post-pass over the base result; see
crate::window::apply_window_fns.
scalar_projections: Vec<ParsedScalarProjection>Scalar-function projections in SELECT clause (v0.5.1).
Applied as a post-pass over the base scan rows: each projection
evaluates a ScalarExpr against the row and appends the
result (with the alias or a synthesised default name) to the
output columns. Parallel to aggregates, case_columns, and
window_fns; empty vec means no scalar projection pass.
Trait Implementations§
Source§impl Clone for ParsedSelect
impl Clone for ParsedSelect
Source§fn clone(&self) -> ParsedSelect
fn clone(&self) -> ParsedSelect
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more