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

One (column, ...) = source item of a SET list: several columns assigned from one row or one sub-SELECT.

Mirrors the MultiAssignRef items PostgreSQL makes of the item. The source must be a row constructor or a scalar subquery with one value per column. The facts follow PG-ASSIGNMENT-001. Source: https://www.postgresql.org/docs/17/sql-update.html.

Reading a multiple-column assignmentdoctest
$update = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('UPDATE t SET (a, b) = (1, 2)');
    count($update->statement->assignments[0]->columns) // => 2
Refusing an empty column listdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Assignment\RowAssignment([], new \SqlSemantics\Platform\PostgreSql\Statement\Literal\NullLiteral()) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public non-empty-list<ColumnTarget> $columns
public Scalar $source

Methods§

public function __construct(list<ColumnTarget> $columns, public Scalar $source)

Parameters

$columnslist<ColumnTarget>The columns written, in order; at least one
$sourceScalarThe row or the sub-SELECT that supplies the values

Throws

InvalidConstruction When there is no column
Calls 2
public function render(Output $out): void

Writes the parenthesized columns, = and the source.

Parameters

$outOutput
Calls 1

Test cases 3§

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 2

Relations§

Instantiated in 1
Constant reads 3
Type checks 2
Type declarations 1