classAssignment
final class Assignment
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One column = value item of UPDATE SET, ON CONFLICT DO UPDATE SET or MERGE UPDATE SET.
Mirrors a ResTarget of an UPDATE target list; the value may be DEFAULT. The facts follow PG-ASSIGNMENT-001. Source: https://www.postgresql.org/docs/17/sql-update.html.
$update = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('UPDATE t SET a = DEFAULT');
$update->statement->assignments[0]->value instanceof \SqlSemantics\Platform\PostgreSql\Statement\Expression\DefaultRequest // => trueProperties§
public ColumnTarget $columnpublic Scalar $valueMethods§
public function __construct(public ColumnTarget $column, public Scalar $value)Parameters
$column | ColumnTarget | The column written |
$value | Scalar | The value assigned |
public function render(Output $out): voidTest cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AssignmentTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 1
Constant reads 3
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Conflict\ConflictDoUpdate::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Conflict/ConflictDoUpdate.php:50
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge\MergeUpdate::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge/MergeUpdate.php:44
- class-const SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::__construct() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:71
Type checks 5
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments::assign() packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:159
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments::assign() packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:164
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments::defaults() packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:259
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\GeneratedWrites::updated() packages/sql-semantics-postgres/src/Rules/Manipulation/GeneratedWrites.php:93
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Manipulation\GeneratedWrites::updated() packages/sql-semantics-postgres/src/Rules/Manipulation/GeneratedWrites.php:96