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.

Reading a renamed joindoctest
$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> $columns
public Name|null $alias = null

Methods§

public function __construct(
    public Join|ParenthesizedJoin $join,
    public Name|null $alias = null,
    list<Name> $columns = [],
)

Parameters

$joinJoin|ParenthesizedJoinThe join inside the parentheses; parentheses inside have no alias
$aliasName|nullThe correlation name
$columnslist<Name>The column names written after the correlation name
Calls 3
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFact

Derives the join and the columns of the occurrence.

Parameters

$derivationDerivation
$environmentEnvironment
Calls 2
public function render(Output $out): void

Writes the join in parentheses and the alias.

Parameters

$outOutput
Calls 3

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 2
Type checks 4
Type declarations 3