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

A VALUES clause: a query whose rows are written out.

Rule: SQLITE-VALUES-001. The values see the enclosing queries and no relation of their own. The result has the width of the first row; a row of another width is reported. SQLite names the result columns column1, column2, and so on. The type of a column is the choice over its values and it can be NULL when one of its values can. Source: https://sqlite.org/lang_select.html#the_values_clause. Status: Implemented.

Reading the output of a VALUES clausedoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze("VALUES (1, 'a'), (2, NULL)");
    [count($query->statement->rows), $query->field(1)->name->value, $query->field(1)->nullability] // => [2, 'column2', \SqlSemantics\Platform\Sqlite\Model\Statement\Type\Nullability::Nullable]

Properties§

public non-empty-list<ValueRow> $rows

Methods§

public function __construct(list<ValueRow> $rows)

Parameters

$rowslist<ValueRow>The rows in written order; at least one
Calls 2
public function deriveStatement(Derivation $derivation): void

Derives the clause as a statement root and records its rows as the output.

Parameters

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

Derives every value and the output fields.

Parameters

$derivationDerivation
$outerEnvironment

Returns

Calls 14
public function render(Output $out): void

Writes the rows.

Parameters

$outOutput
Calls 1

Test cases 27§

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 24

Relations§

Instantiated in 1
Constant reads 1
Type checks 7
Type declarations 11