final class Placement
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Checks the values that only some positions of a statement admit: DEFAULT, MERGE_ACTION() and SELECT INTO.

Rule: PG-PLACEMENT-001. DEFAULT is a value only where a statement assigns it to a column: a value of the VALUES rows of an INSERT or of the INSERT action of MERGE, the value of a SET item, or a field of the row constructor of a multiple-column SET item; anywhere else in the statement it is reported. MERGE_ACTION() is admitted only in the RETURNING list of MERGE, subqueries included. A data-modifying statement checks its own parts; a data-modifying statement nested in it checks its own. A selection with INTO inside a statement that is not a query statement is reported. A WITH clause holding a data-modifying statement is reported anywhere but at the top level of the query a statement runs (PG-MODIFYING-CTE-001). Termination: the structure is a finite tree walked with a stack. Source: https://www.postgresql.org/docs/17/sql-insert.html, https://www.postgresql.org/docs/17/functions-merge-support.html, https://www.postgresql.org/docs/17/sql-selectinto.html. Status: Implemented.

Methods§

public function objects(object $root, bool $nested): list<object>

Answers the structure objects reachable from a root, the root included; data-modifying statements below the root are entered only when asked.

Parameters

$rootobject
$nestedbool

Returns

list<object>
Test cases 1
Called from 3
Calls 4
public function values(
    Node $statement,
    list<DefaultRequest> $defaults,
    list<object> $actions,
    Derivation $derivation,
): void

Reports the DEFAULT values and MERGE_ACTION() calls of a statement that stand where they are not admitted.

Parameters

$statementNode
$defaultslist<DefaultRequest>The DEFAULT values at admitted positions
$actionslist<object>The objects inside which MERGE_ACTION() is admitted
$derivationDerivation
Called from 11
Calls 6

Test cases 1§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1

Relations§

Instantiated in 12
Method calls 20