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

The action UPDATE SET of a MERGE WHEN clause: the target row is updated.

Mirrors a MergeWhenClause with CMD_UPDATE and its target list. Source: https://www.postgresql.org/docs/17/sql-merge.html.

Reading an update actiondoctest
$merge = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('MERGE INTO t USING u ON t.a = u.a WHEN MATCHED THEN UPDATE SET b = DEFAULT');
    count($merge->statement->clauses[0]->action->assignments) // => 1
Refusing an update without assignmentdoctest
new \SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeUpdate([]) // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\InvalidConstruction

Properties§

public non-empty-list<Assignment|RowAssignment> $assignments

Methods§

public function __construct(list<Assignment|RowAssignment> $assignments)

Parameters

$assignmentslist<Assignment|RowAssignment>The SET items in written order; at least one

Throws

InvalidConstruction When there is no SET item
Calls 4
public function render(Output $out): void

Writes UPDATE SET and the assignments.

Parameters

$outOutput
Calls 1

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