ExSQL. AST. Select
(exsql v0.1.4)
Copy Markdown
A SELECT statement.
columns is a list of :star, {:qualified_star, table}, or
{expr, alias | nil} tuples. Expressions are tagged tuples as produced by
ExSQL.Parser — see that module for the expression grammar.
from is a join tree:
nil— no FROM clause{:table, name, alias | nil}{:subquery, %Select{}, alias | nil}{:join, type, left, right, constraint}wheretypeis%{natural: boolean, left: boolean},leftis a join tree,righta single source, andconstraintisnil,{:on, expr}, or{:using, [name]}. Comma joins,CROSS JOIN, andINNER JOINall parse toleft: false— they differ only as planner hints in SQLite.
Summary
Types
@type expr() :: ExSQL.Parser.expr()
@type t() :: %ExSQL.AST.Select{ columns: [:star | {:qualified_star, String.t()} | {expr(), String.t() | nil}], distinct: boolean(), from: source() | nil, group_by: [expr()], having: expr() | nil, limit: expr() | nil, offset: expr() | nil, order_by: [{expr(), :asc | :desc}], where: expr() | nil, windows: %{required(String.t()) => map()} }