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

The VALUES statement: a table of rows written with row constructors (MySQL 8.0.19 and later).

Rule: MYSQL-VALUES-001. The columns are named column_0, column_1 and so on; the type of a column is aggregated over the rows (MYSQL-RESULT-SLOTS-001) and it can be NULL when a value of it can. Rows of different lengths are reported. The values see no column of the query. Source: https://dev.mysql.com/doc/refman/8.4/en/values.html. Status: Implemented.

Reading the rows of VALUESdoctest
$values = new \SqlSemantics\Platform\MySql\Statement\Query\ValuesQuery([new \SqlSemantics\Platform\MySql\Statement\Query\ValueRow([new \SqlSemantics\Platform\MySql\Statement\Literal\NumberLiteral('1')])]);
    count($values->rows) // => 1
Refusing a VALUES statement without rowsdoctest
new \SqlSemantics\Platform\MySql\Statement\Query\ValuesQuery([]) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstruction

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 statement as a statement root and records its rows as the output.

Parameters

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

Derives every value and the output columns.

Parameters

$derivationDerivation
$outerEnvironment

Returns

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

Writes the rows.

Parameters

$outOutput
Test cases 1
Calls 1

Test cases 7§

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

Dedicated tests 5
Other tests reaching this symbol 2

Relations§

Instantiated in 1
Type checks 1
Type declarations 3