classAssignment
final class Assignment
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.One assignment column = value of SET, ON DUPLICATE KEY UPDATE, UPDATE or LOAD DATA.
The statement that holds the assignment resolves the column among the tables it writes and derives the value; = and := are one operator here. Source: https://dev.mysql.com/doc/refman/8.4/en/update.html.
$update = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('UPDATE t SET a = a + 1');
$update->statement->assignments[0]->column->name->value // => 'a'Properties§
public ColumnUse $columnpublic Scalar $valueMethods§
public function __construct(public ColumnUse $column, public Scalar $value)Parameters
$column | ColumnUse | The column assigned to |
$value | Scalar | The value: an expression or DEFAULT |
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 3
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:302
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:309
- new SqlSemantics\Platform\MySql\Lowering\Dml\ValueRule::assignment() packages/sql-semantics-mysql/src/Lowering/Dml/ValueRule.php:119
Constant reads 6
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Insert\InsertQuery::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Insert/InsertQuery.php:46
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Insert\InsertRows::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Insert/InsertRows.php:52
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Insert\InsertSet::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Insert/InsertSet.php:52
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Insert\InsertSet::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Insert/InsertSet.php:53
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Load\LoadTable::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Load/LoadTable.php:103
- class-const SqlSemantics\Platform\MySql\Statement\Dml\Update::__construct() packages/sql-semantics-mysql/src/Statement/Dml/Update.php:74