final class JoinUsing
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

USING (columns) [AS alias]: a join on equal columns of both sides, merged into one column each.

Mirrors the usingClause and join_using_alias of PostgreSQL's JoinExpr. The alias names the merged columns only. Source: https://www.postgresql.org/docs/17/queries-table-expressions.html#QUERIES-JOIN.

Reading a USING clause with an aliasdoctest
$query = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT 1 FROM a JOIN b USING (id) AS j');
    [$query->statement->from->condition->columns[0]->value, $query->statement->from->condition->alias->value] // => ['id', 'j']

Properties§

public non-empty-list<Name> $columns
public Name|null $alias = null

Methods§

public function __construct(list<Name> $columns, public Name|null $alias = null)

Parameters

$columnslist<Name>The merged columns in written order; at least one
$aliasName|nullThe name the merged columns are qualified with
Calls 2
public function render(Output $out): void

Writes USING, the columns and the alias.

Parameters

$outOutput
Calls 4

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type checks 2
Type declarations 2