final class ResultRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\Sqlite". Code outside that scope must not name this declaration.

Lowers result column lists, aliases and VALUES clauses.

Rule: SQLITE-RESULT-LOWER-001. Scope: selcollist, sclp, scanpt, as, distinct (of a selection), values, mvalues. Result columns and rows keep their written order. scanpt is an empty marker of the grammar that carries nothing. A result column without an alias keeps the layout of its expression when it is not the canonical spelling (CORE-SPELLING-001), since SQLite names the column after it; the layout includes a comment written after the expression, which SQLite's name includes. Whether AS introduces an alias is kept, because the text of an enclosing expression includes it. Terminates: both lists are walked along their spine in a loop. Source: https://sqlite.org/lang_select.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function columns(Node $list): list<ResultColumn|Star|TableStar>

Lowers a selcollist into its result columns in written order.

Parameters

$listNode

Throws

ImplementationGap When a production has no rule
Calls 6
public function column(Node $expression, Node $as): ResultColumn

Lowers one projected expression; without an alias it keeps the spelling SQLite names it after.

Parameters

$expressionNode
$asNode

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 9
public function marker(Node $marker): void

Confirms that a scanpt is the empty marker of the grammar, which carries nothing.

Parameters

$markerNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1
public function alias(Node $alias): ?Name

Lowers an as: the alias, or null when none is written.

Parameters

$aliasNode

Returns

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1
public function keyword(Node $alias): bool

Tells whether an as introduces its alias with the keyword AS, or has no alias.

Parameters

$aliasNode

Returns

bool

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1
public function quantifier(Node $distinct): ?SetQuantifier

Lowers the distinct of a selection: the written quantifier, or null when none is written.

Parameters

$distinctNode

Throws

ImplementationGap When the production has no rule
Calls 3
public function values(Node $values): ValuesClause

Lowers a values or mvalues into a VALUES clause with its rows in written order.

Parameters

$valuesNode

Throws

ImplementationGap When a production has no rule
Calls 4

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 1
Type declarations 1