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

Derives the facts of a compound query.

Rule: SQLITE-COMPOUND-SCOPE-001. Every arm is derived in the enclosing environment. The output has the names of the first arm; the type of a column is the choice over the arms and it can be NULL when it can in an arm. Arms of different widths are reported, as are ORDER BY and LIMIT on an arm that is not the last. When the compound is the query of a common table that refers to itself, the arms after the first see the table with the column names of its column list or of the first arm; because later rounds of the recursion feed their own results back, a column of the recursive reference can hold any storage class or NULL. An ORDER BY term is a result column position, or an expression over the result column names of the arms. Terminates: one pass over the arms; no fixpoint is computed. Source: https://sqlite.org/lang_select.html#compound_select_statements, https://sqlite.org/lang_with.html#recursive_common_table_expressions. Status: Implemented.

Methods§

public function aliases(
    list<Query> $arms,
    list<QueryFact> $facts,
    list<Field|OpenStar> $items,
): list<Field>

Answers the result column names of every arm as aliases of the output fields at the same positions.

A name SQLite takes from the text of an expression is no alias an ORDER BY term can name.

Parameters

$armslist<Query>The arms in order
$factslist<QueryFact>The output of each arm
$itemslist<Field|OpenStar>

Returns

list<Field>
Test cases 1
Called from 1
Calls 3
public function spelled(?Query $arm, Field $field): bool

Tells whether an arm names a field after the text of its expression.

Parameters

$arm?Query
$fieldField

Returns

bool
Test cases 1
Called from 1
Calls 2

Test cases 10§

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

Dedicated tests 10

Relations§

Instantiated in 1
Method calls 1