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

Lowers INSERT, UPDATE and DELETE.

Rule: SQLITE-MUTATION-LOWER-001. Scope: the cmd productions of DELETE, UPDATE and INSERT; insert_cmd, xfullname, setlist, where_opt_ret, returning. An INSERT whose source is a bare VALUES clause is an insert of written rows, any other source an insert of a query, DEFAULT VALUES an insert of defaults. Assignments keep their written order and whether the column is written as a parenthesised list. Terminates: the assignment list is walked along its spine in a loop. Source: https://sqlite.org/lang_insert.html, https://sqlite.org/lang_update.html, https://sqlite.org/lang_delete.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
Calls 1
public function command(Form $form): ?Statement

Lowers a data change command, or answers null for another command.

Parameters

$formForm

Returns

Calls 7
public function insert(InsertInto $into, Node $select, Node $upsert): InsertRows|InsertSelect
public function assignments(Node $list): list<Assignment|RowAssignment>

Lowers a setlist into its assignments in written order.

Parameters

$listNode

Throws

ImplementationGap When a production has no rule
Called from 1
Calls 6
public function whereReturning(Node $tail): array{Scalar|null, list<ResultColumn|Star|TableStar>}
public function returning(Node $returning): list<ResultColumn|Star|TableStar>

Lowers a returning: the RETURNING columns, or none when the clause is absent.

Parameters

$returningNode

Throws

ImplementationGap When the production has no rule
Called from 1
Calls 1

Private surface 2§

Implementation details, listed for orientation only.

private UpsertRule $upserts
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 1
Type declarations 1