classRoots
final class Roots
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.
Derives a data-modifying statement that is a whole statement.
Rule: PG-MODIFICATION-ROOT-001. The statement is derived in the empty environment; the rows of its RETURNING list are its output, and without RETURNING it returns no rows. A selection with INTO anywhere inside is reported (PG-PLACEMENT-001), and so is a WITH clause holding a data-modifying statement anywhere but before the statement itself (PG-MODIFYING-CTE-001). Source: https://www.postgresql.org/docs/17/dml-returning.html. Status: Implemented.
Methods§
public function derive(Modification $root, Derivation $derivation): voidDerives the statement and records its rows.
Parameters
$root | Modification | |
$derivation | Derivation |
Called from 6
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Delete::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Delete.php:82
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertDefaults::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertDefaults.php:81
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertRows::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertRows.php:97
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:102
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge.php:94
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:96
Calls 9
- method-call Derivation::query() line 31
- method-call Derivation::environment() line 31
- method-call Placement::into() line 32
- new Placement line 32
- method-call Modification::commonTables() line 33
- method-call ModifyingCommonTables::check() line 34
- new ModifyingCommonTables line 34
- method-call Modification::returnsRows() line 35
- method-call Derivation::output() line 36
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
RootsTestcalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Delete::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Delete.php:82
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertDefaults::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertDefaults.php:81
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertRows::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertRows.php:97
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:102
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge.php:94
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:96
Method calls 6
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Delete::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Delete.php:82
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertDefaults::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertDefaults.php:81
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertRows::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertRows.php:97
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\InsertSelect::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/InsertSelect.php:102
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Merge::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Merge.php:94
- method-call SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Update::deriveStatement() packages/sql-semantics-postgres/src/Statement/Manipulation/Update.php:96