final class InsertDefaults
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

An INSERT of one row made of the default values of the columns.

Rule: SQLITE-INSERT-DEFAULTS-001. The facts follow SQLITE-INSERT-001 without a source of rows. Source: https://sqlite.org/lang_insert.html. Status: Implemented.

Reading an INSERT of default valuesdoctest
$insert = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('INSERT INTO t DEFAULT VALUES RETURNING *');
    [$insert->statement->into->target->name->name->value, count($insert->statement->returning), $insert->toString()] // => ['t', 1, 'INSERT INTO t DEFAULT VALUES RETURNING *']

Properties§

public list<ResultColumn|Star|TableStar> $returning
public InsertInto $into

Methods§

public function __construct(
    public InsertInto $into,
    list<ResultColumn|Star|TableStar> $returning = [],
)

Parameters

$intoInsertIntoThe head: verb, written table and column list
$returninglist<ResultColumn|Star|TableStar>The RETURNING columns

Throws

InvalidConstruction When a RETURNING column is of no result column class
Calls 5
public function deriveStatement(Derivation $derivation): void

Derives the statement as a root and records the rows of RETURNING as the output.

Parameters

$derivationDerivation
Calls 5
public function deriveWithin(Derivation $derivation, Environment $outer): ?QueryFact

Derives the statement inside an environment, as a trigger program does, and answers the rows it returns.

Parameters

$derivationDerivation
$outerEnvironment

Returns

Called from 1
Calls 2
public function render(Output $out): void

Writes the statement.

Parameters

$outOutput
Calls 2

Test cases 6§

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

Dedicated tests 3
Other tests reaching this symbol 3

Relations§

Instantiated in 1
Type declarations 1