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

Lowers ordering terms and column name lists.

Rule: SQLITE-SORT-LOWER-001. Scope: sortlist, sortorder, nulls, eidlist, eidlist_opt, orderby_opt. Terms keep their written order, direction and NULL placement. In the ORDER BY clause of a query an integer constant is a request for the result column at that position; everywhere else it is an ordinary constant. Terminates: lists are flattened iteratively. Source: https://sqlite.org/lang_select.html#the_order_by_clause, https://sqlite.org/syntax/indexed-column.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function terms(Node $sortlist, bool $ordinals = false): list<SortTerm>

Lowers a sortlist into its terms in written order.

Parameters

$sortlistNode
$ordinalsboolWhether an integer constant names a result column, as in the ORDER BY clause of a query

Returns

list<SortTerm>

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 10
public function orderBy(Node $clause, bool $ordinals = false): list<SortTerm>

Lowers an orderby_opt of a query: its terms, or none when the clause is absent.

Parameters

$clauseNode
$ordinalsbool

Returns

list<SortTerm>

Throws

ImplementationGap When the production has no rule
Calls 2
public function nulls(Node $nulls): ?NullsOrder

Lowers a nulls: the written NULL placement, or null when none is written.

Parameters

$nullsNode

Returns

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 3
public function columns(Node $eidlist): list<ListedColumn>

Lowers an eidlist into its column names in written order.

Parameters

$eidlistNode

Returns

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 6
public function optionalColumns(Node $list): list<ListedColumn>|null

Lowers an eidlist_opt: the column names, or null when the list is absent.

Parameters

$listNode

Returns

list<ListedColumn>|null

Throws

ImplementationGap When the production has no rule
Calls 2

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