classChangeFacts
final class ChangeFacts
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.
Derives the facts of UPDATE and DELETE.
Rule: PG-CHANGE-001. The common tables, the target, the FROM items of UPDATE and the USING items of DELETE follow PG-MODIFICATION-SCOPE-001. The SET items (PG-ASSIGNMENT-001), the WHERE condition and RETURNING see the target and those items. WHERE CURRENT OF names a cursor, which is session state. Source: https://www.postgresql.org/docs/17/sql-update.html, https://www.postgresql.org/docs/17/sql-delete.html. Status: Implemented.
Methods§
public function update(Update $update, Derivation $derivation, Environment $outer): QueryFactDerives an UPDATE and answers its rows.
Parameters
$update | Update | |
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 1
Calls 11
- new ModificationScope line 34
- method-call ModificationScope::open() line 35
- method-call ModificationScope::inputs() line 36
- new Environment line 37
- new Assignments line 38
- method-call Assignments::assign() line 39
- method-call ChangeFacts::where() line 40
- method-call Placement::values() line 41
- new Placement line 41
- method-call Assignments::defaults() line 41
- method-call ModificationScope::returning() line 43
public function delete(Delete $delete, Derivation $derivation, Environment $outer): QueryFactDerives a DELETE and answers its rows.
Parameters
$delete | Delete | |
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 1
Calls 8
- new ModificationScope line 51
- method-call ModificationScope::open() line 52
- method-call ModificationScope::inputs() line 53
- method-call ChangeFacts::where() line 54
- new Environment line 54
- method-call Placement::values() line 55
- new Placement line 55
- method-call ModificationScope::returning() line 57
public function where(
Scalar|CurrentOf|null $where,
Derivation $derivation,
Environment $environment,
): voidDerives the WHERE condition or the cursor position.
Parameters
$where | Scalar|CurrentOf|null | |
$derivation | Derivation | |
$environment | Environment |
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Rules\Manipulation\ChangeFacts::update() packages/sql-semantics-postgres/src/Rules/Manipulation/ChangeFacts.php:40
- method-call SqlSemantics\Platform\PostgreSql\Rules\Manipulation\ChangeFacts::delete() packages/sql-semantics-postgres/src/Rules/Manipulation/ChangeFacts.php:54
Calls 1
- method-call Derivation::scalar() line 68
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ChangeFactsTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Delete::deriveQuery() packages/sql-semantics-postgres/src/Statement/Manipulation/Delete.php:90
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::deriveQuery() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:104
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Delete::deriveQuery() packages/sql-semantics-postgres/src/Statement/Manipulation/Delete.php:90
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::deriveQuery() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:104