final class InsertRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Lowers INSERT.

Rule: PG-INSERT-LOWER-001. Scope: InsertStmt, insert_target, insert_rest, override_kind, insert_column_list, insert_column_item, opt_on_conflict, opt_conf_expr. Constructors: InsertRows when the query is VALUES alone, in parentheses or none (the grammar keeps no node for them), InsertSelect for any other query, InsertDefaults for DEFAULT VALUES; TargetTable, ColumnTarget, Overriding, ConflictDoNothing, ConflictDoUpdate, IndexInference, ConstraintInference. Termination: lists are flattened iteratively; parentheses around VALUES are unwrapped one per level. Source: https://www.postgresql.org/docs/17/sql-insert.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function rest(Form $rest): array{list<ColumnTarget>, Overriding|null, Query}

Lowers the forms of insert_rest that hold a query: the column list, the override and the query.

Parameters

$restForm

Returns

array{list<ColumnTarget>, Overriding|null, Query}

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 4
public function rows(Query $query): ValueRows|ParenthesizedRows|null

Answers the VALUES rows a query is, when it is VALUES alone in parentheses or none; otherwise null.

Parameters

$queryQuery
Called from 1
Calls 2

Private surface 1§

Implementation details, listed for orientation only.

private Lowering $lowering

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 2
Method calls 5