classRowExpression
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.
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT (a, b) = (1, 2) FROM t');
count($query->statement->columns[0]->expression->left->items) // => 2new \SqlSemantics\Platform\Sqlite\Statement\Expression\RowExpression([new \SqlSemantics\Platform\Sqlite\Statement\Expression\Literal\NullLiteral()]) // throws \SqlSemantics\Platform\Sqlite\Model\Diagnostic\InvalidConstructionProperties§
public non-empty-list<Scalar> $itemsMethods§
public function __construct(list<Scalar> $items)Parameters
$items | list<Scalar> | The elements in order; at least two |
Calls 2
- static-call Check::listOf() line 47
- class-const Scalar::class() line 47
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives every element and the row type.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 6
- class-const Nullability::NotNull() line 55
- method-call Derivation::scalar() line 57
- new ScalarFact line 60
- new Known line 60
- new Vector line 60
- function-call
countline 60
public function render(Output $out): voidWrites the elements in parentheses.
Parameters
$out | Output |
Calls 1
- method-call Output::symbol() line 68
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
ExpressionRuleTest::testExpressionLowersCollateCastAndRowExpressionscallsMutationRuleTest::testAssignmentsKeepsTheWrittenOrderAndTheListFormcallsLimitsTest::testClassifyNamesEachRejectedNodecallsLimitsTest::testNonConstantFindsWhatADefaultMayNotContaincallsLiteralDefaultsTest::testConstantLooksThroughParenthesesSignsAndCastscallsMutationScopeTest::testAssignChecksTheColumnsAndTheWidthOfEachAssignmentcallsSortScopesTest::testDeriveResolvesAnOrdinalAgainstTheProjectionAndReportsARowValuecallsRowAssignmentTest::testRenderWritesTheColumnListAndTheValuecalls
Relations§
Instantiated in 1
Type checks 2
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::of() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:85
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ValueKinds::of() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ValueKinds.php:104