SelectStmt class

Inheritance

Constructors

SelectStmt({required List<SelectItem> projection, String? fromTable, SelectStmt? fromSubquery, String? fromAlias, List<JoinClause> joins = const [], Expr? where, List<Expr> groupBy = const [], Expr? having, List<OrderByItem> orderBy = const [], int? limit, int? offset, bool distinct = false, String? setOp, SelectStmt? setOpRight, Map<String, SelectStmt> ctes = const {}, Map<String, List<String>> cteColumns = const {}, bool ctesRecursive = false, Map<String, bool> cteMaterialized = const {}, FunctionCallExpr? fromFunction, Map<String, WindowSpec> namedWindows = const {}, IndexHint? indexedBy, List<List<Expr>>? groupingSets})

Properties

cteColumns → Map<String, List<String>>
Optional explicit column names per CTE: WITH name(c1, c2) AS (...).
final
cteMaterialized → Map<String, bool>
Per-CTE materialization hint. Key = CTE name, value = true for MATERIALIZED, false for NOT MATERIALIZED. CTEs without an explicit hint are absent from the map (default = planner's choice).
final
ctes → Map<String, SelectStmt>
Optional WITH name AS (...) CTE bindings. Visible to this SELECT and any subqueries it nests.
final
ctesRecursive → bool
True when introduced via WITH RECURSIVE ....
final
distinct → bool
final
fromAlias → String?
final
fromFunction → FunctionCallExpr?
When the FROM clause is a table-valued function call (e.g. json_each(...)), the call is captured here. Mutually exclusive with fromTable / fromSubquery.
final
fromSubquery → SelectStmt?
final
fromTable → String?
Either fromTable or fromSubquery may be non-null (or both null when the SELECT has no FROM).
final
groupBy → List<Expr>
final
groupingSets → List<List<Expr>>?
When the GROUP BY clause uses ROLLUP / CUBE / GROUPING SETS, this holds the expanded list of grouping-key sets (one list per set). groupBy then holds the union of every set's keys for binding / validation; the executor iterates groupingSets, runs the aggregation per set, and unions the results.
final
hashCode → int
The hash code for this object.
no setterinherited
having → Expr?
final
indexedBy → IndexHint?
Optional INDEXED BY / NOT INDEXED hint attached to the FROM table.
final
joins → List<JoinClause>
final
limit → int?
final
namedWindows → Map<String, WindowSpec>
Named WINDOW clauses: WINDOW w AS (PARTITION BY ... ORDER BY ...). Visible to all OVER w references in this SELECT.
final
offset → int?
final
orderBy → List<OrderByItem>
final
projection → List<SelectItem>
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setOp → String?
Optional set-operation chain (UNION / UNION ALL / EXCEPT / INTERSECT). When present, this SELECT's result is combined with setOpRight.
final
setOpRight → SelectStmt?
final
where → Expr?
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited