classInsertDefaults
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.
$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> $returningpublic InsertInto $intoMethods§
public function __construct(
public InsertInto $into,
list<ResultColumn|Star|TableStar> $returning = [],
)Parameters
$into | InsertInto | The head: verb, written table and column list |
$returning | list<ResultColumn|Star|TableStar> | The RETURNING columns |
Throws
InvalidConstruction When a RETURNING column is of no result column classCalls 5
- method-call ClosedList::of() line 49
- new ClosedList line 49
- class-const ResultColumn::class() line 49
- class-const Star::class() line 49
- class-const TableStar::class() line 49
public function deriveStatement(Derivation $derivation): voidDerives the statement as a root and records the rows of RETURNING as the output.
Parameters
$derivation | Derivation |
Calls 5
- method-call ProgramOnly::outsideProgram() line 57
- new ProgramOnly line 57
- method-call InsertDefaults::deriveWithin() line 58
- method-call Derivation::environment() line 58
- method-call Derivation::output() line 60
public function deriveWithin(Derivation $derivation, Environment $outer): ?QueryFactDerives the statement inside an environment, as a trigger program does, and answers the rows it returns.
Parameters
$derivation | Derivation | |
$outer | Environment |
Returns
Called from 1
Calls 2
- method-call InsertFacts::derive() line 69
- new InsertFacts line 69
public function render(Output $out): voidWrites the statement.
Parameters
$out | Output |
Calls 2
- method-call Output::node() line 77
- method-call Output::keyword() line 79
Test cases 6§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.