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

Derives the facts of an INSERT statement.

Rule: SQLITE-INSERT-001. The source query is derived where the common tables of the statement are visible; it does not see the written table. The source must supply one value per column of the column list, or per column of the table that is not generated when no list is written; another count is reported when both counts are known. Writes of generated columns follow SQLITE-GENERATED-WRITE-001. In an ON CONFLICT clause the conflict target sees the written table; DO UPDATE sees the written table and, under the qualifier excluded, the row that could not be inserted. An ON CONFLICT clause on a view is reported (SQLITE-RELATION-KIND-001). RETURNING follows SQLITE-MUTATION-SCOPE-001. Source: https://sqlite.org/lang_insert.html, https://sqlite.org/lang_upsert.html. Status: Implemented.

Methods§

public function derive(
    InsertInto $into,
    Query|null $source,
    list<Upsert> $upserts,
    list<ResultColumn|Star|TableStar> $returning,
    Derivation $derivation,
    Environment $outer,
): ?QueryFact

Derives every part of an INSERT and answers the rows it returns, or null when it returns none.

Parameters

$intoInsertInto
$sourceQuery|nullThe query that supplies the rows; null for DEFAULT VALUES
$upsertslist<Upsert>
$returninglist<ResultColumn|Star|TableStar>
$derivationDerivation
$outerEnvironment

Returns

Test cases 4
Called from 3
Calls 24

Test cases 4§

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

Dedicated tests 4

Relations§

Instantiated in 3
Method calls 3