final class FromRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Lowers FROM clauses and their items.

Rule: PG-FROM-LOWER-001. Scope: from_clause, from_list, table_ref, joined_table, join_type, opt_outer, join_qual, alias_clause, opt_alias_clause, opt_alias_clause_for_join_using, func_alias_clause, relation_expr, extended_relation_expr, relation_expr_list, tablesample_clause, opt_repeatable_clause, func_table, rowsfrom_list, rowsfrom_item, opt_col_def_list, opt_ordinality. Constructors: TableInput, RelationReference, TableSample, DerivedTable, FunctionTable, TableFunction, Join, JoinOn, JoinUsing, ParenthesizedJoin, RelationList. Several comma-separated items become a RelationList; one item stays itself. INNER and OUTER are noise words. Termination: lists are flattened iteratively; joins recurse on the tree depth. Source: https://www.postgresql.org/docs/17/sql-select.html#SQL-FROM. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function reference(Node $reference): Relation

Lowers table_ref.

Parameters

$referenceNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 7
Calls 11
public function renamedJoin(Form $form): ParenthesizedJoin
public function alias(Node $alias): array{Name|null, list<Name>}

Lowers opt_alias_clause or alias_clause: the correlation name and the column names; no alias has neither.

Parameters

$aliasNode

Returns

array{Name|null, list<Name>}

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 9
Calls 2
public function functionAlias(Node $alias): array{Name|null, list<Name>, list<TypedColumn>}

Lowers func_alias_clause: the correlation name, the column names and the column definitions.

Parameters

$aliasNode

Returns

array{Name|null, list<Name>, list<TypedColumn>}

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2
public function sample(Node $clause): TableSample

Private surface 2§

Implementation details, listed for orientation only.

private const KINDS = ['join_type: FULL opt_outer' => \SqlSemantics\Platform\PostgreSql\Statement\Rel…
private Lowering $lowering

Test cases 17§

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

Dedicated tests 17

Relations§

Instantiated in 7
Method calls 7