final class RowExpression
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A row value: two or more expressions in parentheses, compared or assigned as one.

Rule: SQLITE-ROW-VALUE-001. The type is a row of the width written. A comparison of row values is NULL when a deciding element is NULL, so the NULL fact is that of the elements combined. Source: https://sqlite.org/rowvalue.html. Status: Implemented.

Reading the elements of a row valuedoctest
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT (a, b) = (1, 2) FROM t');
    count($query->statement->columns[0]->expression->left->items) // => 2
Refusing a row of one element, which is a groupingdoctest
new \SqlSemantics\Platform\Sqlite\Statement\Expression\RowExpression([new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\NullLiteral()]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstruction

Properties§

public non-empty-list<Scalar> $items

Methods§

public function __construct(list<Scalar> $items)

Parameters

$itemslist<Scalar>The elements in order; at least two
Calls 2
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives every element and the row type.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

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

Writes the elements in parentheses.

Parameters

$outOutput
Calls 1

Test cases 10§

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

Dedicated tests 2
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Type checks 2