classParenthesizedJoin
final class ParenthesizedJoin
implements Relation
uses Snapshot
Public API: explicitly declared with
@visibility public.A join in parentheses, optionally renamed.
Without an alias the parentheses only group. An alias names the joined row and hides the FROM items inside: they can no longer be referred to by their names. The facts follow PG-JOIN-001. Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-JOIN. Status: Implemented.
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 FROM (a CROSS JOIN b) AS j');
[$query->statement->from->alias->value, $query->toString()] // => ['j', 'SELECT 1 FROM (a CROSS JOIN b) AS j']Properties§
public list<Name> $columnspublic Join|ParenthesizedJoin $joinpublic Name|null $alias = nullMethods§
public function __construct(
public Join|ParenthesizedJoin $join,
public Name|null $alias = null,
list<Name> $columns = [],
)Parameters
$join | Join|ParenthesizedJoin | The join inside the parentheses; parentheses inside have no alias |
$alias | Name|null | The correlation name |
$columns | list<Name> | The column names written after the correlation name |
Calls 3
- static-call Check::listOf() line 47
- class-const Name::class() line 47
- static-call Check::input() line 48
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactDerives the join and the columns of the occurrence.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call FromScope::enter() line 57
- new FromScope line 57
public function render(Output $out): voidWrites the join in parentheses and the alias.
Parameters
$out | Output |
Calls 3
- method-call Output::symbol() line 65
- method-call AliasSpelling::write() line 66
- new AliasSpelling line 66
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ParenthesizedJoinTestcalls
Relations§
Instantiated in 2
Type checks 4
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::refused() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:139
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Query\Locking::tables() packages/sql-semantics-postgres/src/Rules/Query/Locking.php:156
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Resolution\FromScope::open() packages/sql-semantics-postgres/src/Rules/Resolution/FromScope.php:55
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Resolution\FromScope::enter() packages/sql-semantics-postgres/src/Rules/Resolution/FromScope.php:102
Type declarations 3
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:156
- type SqlSemantics\Platform\PostgreSql\Lowering\Query\FromRule packages/sql-semantics-postgres/src/Lowering/Query/FromRule.php:172
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\FromScope packages/sql-semantics-postgres/src/Rules/Resolution/FromScope.php:92