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

Derives the input relations of a FROM clause and the relations they make visible to names.

Rule: SQLITE-FROM-SCOPE-001. A table, a table-valued function and a derived query are each one visible relation under their correlation name, or under their table name when they have none. The arguments of a table-valued function see the relations to its left; a derived query sees none of its siblings. A chain combines its terms from left to right by SQLITE-JOIN-001 and derives every ON condition where all its relations are visible. Parentheses around several terms keep the relations inside visible and add their correlation name for the joined row; parentheses around one term replace its correlation name with their own, except that plain parentheses at the very start of a FROM clause change nothing. Terminates: chains are walked in a loop; recursion follows parentheses. Source: https://sqlite.org/lang_select.html#the_from_clause. Status: Implemented.

Methods§

public function open(
    Relation $term,
    Derivation $derivation,
    Environment $outer,
    list<VisibleRelation> $left = [],
    bool $leading = true,
): JoinedInput

Derives one term, records its facts and answers what it makes visible.

Parameters

$termRelation
$derivationDerivation
$outerEnvironment
$leftlist<VisibleRelation>The relations to the left of the term in its chain
$leadingboolWhether the term starts a FROM clause and carries no constraint
Test cases 3
Called from 5
Calls 10
public function enter(
    JoinChain|NestedInput $node,
    Derivation $derivation,
    Environment $outer,
    list<VisibleRelation> $left,
    bool $leading,
): JoinedInput

Derives the terms of a chain or of parentheses without recording the facts of the node itself.

Parameters

$nodeJoinChain|NestedInput
$derivationDerivation
$outerEnvironment
$leftlist<VisibleRelation>The relations to the left of the node in its chain
$leadingbool
Test cases 2
Called from 3
Calls 18
public function nested(
    NestedInput $node,
    Derivation $derivation,
    Environment $outer,
    bool $leading,
): JoinedInput

Derives the terms inside parentheses and answers what the parentheses make visible.

Around one term the parentheses replace its correlation name with their own, unless they are plain parentheses at the very start of a FROM clause; around several terms the relations inside stay visible, and a correlation name on the parentheses names the joined row, reachable with that qualifier only.

Parameters

$nodeNestedInput
$derivationDerivation
$outerEnvironment
$leadingbool
Test cases 2
Called from 1
Calls 6
public function star(list<VisibleRelation> $visible): RowShape

Answers the row that * selects from visible relations: every column except the merged ones, without the relations reachable by qualifier only.

Parameters

$visiblelist<VisibleRelation>

Returns

Test cases 1
Called from 1
Calls 4

Test cases 8§

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

Dedicated tests 8

Relations§

Instantiated in 4
Method calls 4