classChangeRule
final class ChangeRule
Lowers UPDATE and DELETE, and the clauses the data-modifying statements share.
Rule: PG-CHANGE-LOWER-001. Scope: UpdateStmt, DeleteStmt, using_clause, set_clause_list, set_clause, set_target, set_target_list, relation_expr_opt_alias, where_or_current_clause, returning_clause, cursor_name. Constructors: Update, Delete, TargetTable, Assignment, RowAssignment, ColumnTarget, CurrentOf. The AS before a correlation name is optional. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-update.html, https://www.postgresql.org/docs/17/sql-delete.html. Status: Implemented.
Methods§
Lowers UpdateStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- static-call ImplementationGap::production() line 54
- new Update line 57
- method-call ChangeRule::target() line 59
- method-call ChangeRule::assignments() line 60
- method-call ChangeRule::where() line 62
- method-call ChangeRule::returning() line 63
Lowers DeleteStmt.
Parameters
$statement | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 6
- static-call ImplementationGap::production() line 76
- new Delete line 79
- method-call ChangeRule::target() line 81
- method-call ChangeRule::using() line 82
- method-call ChangeRule::where() line 83
- method-call ChangeRule::returning() line 84
Lowers using_clause; no clause is null.
Parameters
$clause | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 1
- static-call ImplementationGap::production() line 100
public function target(Node $target): TargetTableLowers relation_expr_opt_alias.
Parameters
$target | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::update() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:59
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::delete() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:81
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::merge() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:86
Calls 2
- new TargetTable line 114
- static-call ImplementationGap::production() line 117
public function assignments(Node $list): list<Assignment|RowAssignment>Lowers set_clause_list.
Parameters
$list | Node |
Returns
list<Assignment|RowAssignment>Throws
ImplementationGap When an item has no ruleCalled from 3
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::update() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:60
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::conflict() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:189
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::action() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:142
Calls 6
- method-call Lowering::items() line 131
- new Assignment line 134
- method-call ChangeRule::column() line 134
- new RowAssignment line 135
- method-call ChangeRule::columns() line 135
- static-call ImplementationGap::production() line 136
public function columns(Node $list): list<ColumnTarget>Lowers set_target_list.
Parameters
$list | Node |
Returns
list<ColumnTarget>Called from 1
Calls 2
- method-call Lowering::items() line 151
- method-call ChangeRule::column() line 152
public function column(Node $target): ColumnTargetLowers set_target.
Parameters
$target | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::assignments() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:134
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::columns() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:152
Calls 2
- static-call ImplementationGap::production() line 167
- new ColumnTarget line 170
Lowers where_or_current_clause; no clause is null.
Parameters
$clause | Node |
Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::update() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:62
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::delete() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:83
Calls 3
- new CurrentOf line 184
- method-call ChangeRule::cursor() line 184
- static-call ImplementationGap::production() line 186
Lowers returning_clause; no clause is an empty list.
Parameters
$clause | Node |
Returns
list<Target>Throws
ImplementationGap When the production has no ruleCalled from 5
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::update() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:63
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::delete() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:84
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:68
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:72
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::merge() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:94
Calls 1
- static-call ImplementationGap::production() line 204
Lowers cursor_name.
Parameters
$name | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 4
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\ChangeRule::where() packages/sql-semantics-postgres/src/Lowering/Manipulation/ChangeRule.php:184
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::declare() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:92
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::fetch() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:135
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::close() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:164
Calls 1
- static-call ImplementationGap::production() line 217
Private surface 1§
Implementation details, listed for orientation only.
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
ChangeRuleTestcalls
Relations§
Instantiated in 10
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::declare() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:92
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::fetch() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:135
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::close() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:164
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:68
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:72
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::conflict() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:189
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:41
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:42
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::merge() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:84
- new SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::action() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:142
Method calls 11
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::declare() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:92
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::fetch() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:135
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\CursorRule::close() packages/sql-semantics-postgres/src/Lowering/Manipulation/CursorRule.php:164
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:68
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::insert() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:72
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\InsertRule::conflict() packages/sql-semantics-postgres/src/Lowering/Manipulation/InsertRule.php:189
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:41
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\Manipulations::statement() packages/sql-semantics-postgres/src/Lowering/Manipulation/Manipulations.php:42
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::merge() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:86
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::merge() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:94
- method-call SqlSemantics\Platform\PostgreSql\Lowering\Manipulation\MergeRule::action() packages/sql-semantics-postgres/src/Lowering/Manipulation/MergeRule.php:142