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

Derives the FROM items of a query and the relations they make visible to names.

Rule: PG-FROM-SCOPE-001. A table, a subquery, a function call, XMLTABLE and JSON_TABLE are each one visible relation under their alias, or without one under their table name, function name, xmltable or json_table; a subquery without alias can only be read through * and unqualified names. A function call, XMLTABLE, JSON_TABLE and a LATERAL subquery see the FROM items before them (at the top level and on the left of the joins they are on the right of; the left side of a RIGHT or FULL join is visible but must not be referenced, PG-LATERAL-JOIN-001); any other item sees only the enclosing query. A join follows PG-JOIN-001; its ON condition sees its two sides and the enclosing query only. A join in parentheses with an alias hides the items inside and is one relation under the alias; without an alias the parentheses change nothing. The items of a comma list follow each other. Terminates: lists are walked in loops; recursion follows the nesting of joins. Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-FROM, https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-LATERAL. Status: Implemented.

Methods§

public function open(
    Relation $item,
    Derivation $derivation,
    Environment $outer,
    list<VisibleRelation> $left,
): JoinedInput

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

Parameters

$itemRelation
$derivationDerivation
$outerEnvironment
$leftlist<VisibleRelation>The relations of the FROM items before the item, which lateral items see
Called from 8
Calls 6
public function enter(
    Join|ParenthesizedJoin|RelationList $node,
    Derivation $derivation,
    Environment $outer,
    list<VisibleRelation> $left,
): JoinedInput

Derives the items of a join, of parentheses or of a comma list, without recording the facts of the node itself.

Parameters

$nodeJoin|ParenthesizedJoin|RelationList
$derivationDerivation
$outerEnvironment
$leftlist<VisibleRelation>The relations of the FROM items before the node, which lateral items see
Called from 4
Calls 17

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 7
Method calls 7