classValueRule
final class ValueRule
Lowers values and assignments: the expression lists of rows and the SET lists.
Rule: MYSQL-DML-VALUES-001. Scope: opt_values, values, expr_or_default, update_list, update_elem, insert_update_list, insert_update_elem, ident_eq_list, ident_eq_value. A value is an expression or the keyword DEFAULT (DefaultRequest); an assignment is a column and a value (Assignment), with = and := as one operator. Terminates: lists are flattened by MYSQL-DML-LIST-001, expressions are strict subtrees. Source: https://dev.mysql.com/doc/refman/8.4/en/insert.html, https://dev.mysql.com/doc/refman/8.4/en/update.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
public function row(Node $values): list<Scalar>Lowers the values of one row: a node of opt_values or values.
Parameters
$values | Node |
Returns
list<Scalar>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 61
- method-call ListRule::items() line 67
- new ListRule line 67
- method-call ValueRule::value() line 68
Lowers one value: a node of expr_or_default.
Parameters
$value | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:302
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:309
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ValueRule::row() packages/sql-semantics-mysql/src/Lowering/Dml/ValueRule.php:68
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ValueRule::assignment() packages/sql-semantics-mysql/src/Lowering/Dml/ValueRule.php:119
Calls 3
- method-call Lowering::form() line 81
- new DefaultRequest line 85
- static-call ImplementationGap::production() line 86
public function assignments(Node $list): list<Assignment>Lowers a list of assignments: a node of update_list, insert_update_list or ident_eq_list.
Parameters
$list | Node |
Returns
list<Assignment>Throws
ImplementationGap When a production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::update() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:95
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::legacy() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:123
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::updates() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:216
Calls 4
- method-call ListRule::items() line 99
- new ListRule line 99
- class-const ValueRule::ASSIGNMENT_LISTS() line 99
- method-call ValueRule::assignment() line 100
public function assignment(Node $assignment): AssignmentLowers one assignment: a node of update_elem, insert_update_elem or ident_eq_value.
Parameters
$assignment | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 5
- method-call Lowering::form() line 113
- class-const ValueRule::ASSIGNMENTS() line 114
- static-call ImplementationGap::production() line 115
- new Assignment line 119
- method-call ValueRule::value() line 119
Private surface 3§
Implementation details, listed for orientation only.
private const ASSIGNMENT_LISTS = ['update_list: update_list , update_elem', 'update_list: update_elem', 'insert_…private const ASSIGNMENTS = ['update_elem: simple_ident_nospvar equal expr_or_default' => true, 'insert_upd…private Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ValueRuleTestcalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::update() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:95
- new SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::rowValues() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:121
- new SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:102
- new SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::legacy() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:123
- new SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::updates() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:216
- new SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:294
Method calls 7
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\ChangeRule::update() packages/sql-semantics-mysql/src/Lowering/Dml/ChangeRule.php:95
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\DmlRules::rowValues() packages/sql-semantics-mysql/src/Lowering/Dml/DmlRules.php:121
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::statement() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::legacy() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:123
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\Insert\InsertRule::updates() packages/sql-semantics-mysql/src/Lowering/Dml/Insert/InsertRule.php:216
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:302
- method-call SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule::assignments() packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:309