classGrouped
final class Grouped
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.An expression written in parentheses.
The grouping fixes the evaluation structure of its operand and is kept as written; rendering never adds or removes a grouping.
Rule: SQLITE-GROUPED-001. The type and the NULL fact are those of the operand. The name resolution stays with the operand, the node that is the name use; rules that look through groupings read it there. Source: https://sqlite.org/lang_expr.html. Status: Implemented.
(new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT (1 + 2) * 3')->toString() // => 'SELECT (1 + 2) * 3'Properties§
public Scalar $operandMethods§
public function __construct(public Scalar $operand)Parameters
$operand | Scalar | The grouped expression |
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operand; the grouping has its type and NULL fact.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call Derivation::scalar() line 45
- new ScalarFact line 47
public function render(Output $out): voidTest cases 21§
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 19
ConnectionRuleTest::testOperandReadsAnIdentifierInsideParenthesesAsItsNamecallsKeyTermRuleTest::testExpressionRebuildsTheWrappersInOrderAroundTheLiteralcallsKeyTermRuleTest::testIndexTermsWrapAStringUnderAtMostOneCollationcallsKeyTermRuleTest::testKeyTermsWrapAStringUnderAnyParenthesesAndCollationscallsKeyTermRuleTest::testTermLeavesEveryOtherTermAsItIscallsExpressionRuleTest::testExpressionKeepsEveryParenthesisPairAsAGroupingcallsLiteralDefaultsTest::testCoreRemovesTheParenthesescallsKeyTermsTest::testBeneathStopsAtTheCollationLimitcallsKeyTermsTest::testColumnReadsAPlainNameAStringAndADoubleQuotedWordcallsKeyTermsTest::testCoreLooksThroughParenthesesAndCollationscallsKeyTermsTest::testStringTellsALiteralUnderTheAdmittedWrapperscallsPrecedenceTest::testEdgesAnswersTheLevelAndBothOperandsOfABinaryOperationcallsOrdinalsTest::testValueLooksThroughSignsCollationsAndParenthesescallsResultNamesTest::testInnerLooksThroughParenthesesCollateAndTheLikelihoodFunctionscallsResultNamesTest::testWrittenAnswersTheOneWordAnExpressionConsistsOfcallsSortScopesTest::testWordAnswersAnUnqualifiedWordOnlycallsColumnFactsTest::testDenotedAnswersTheOutcomeOfAnUngroupedNameUsecallsOutputOrdinalTest::testPositionCountsFromOnecallsTableUniqueTest::testRefusesAStringLiteralTermThatNamesAColumncalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\ConnectionRule::operand() packages/sql-semantics-sqlite/src/Lowering/Definition/ConnectionRule.php:105
- new SqlSemantics\Platform\Sqlite\Lowering\Definition\KeyTermRule::expression() packages/sql-semantics-sqlite/src/Lowering/Definition/KeyTermRule.php:82
- new SqlSemantics\Platform\Sqlite\Lowering\Expression\ExpressionRule::expression() packages/sql-semantics-sqlite/src/Lowering/Expression/ExpressionRule.php:67
Type checks 19
- instanceof SqlSemantics\Platform\Sqlite\Lowering\Definition\KeyTermRule::expression() packages/sql-semantics-sqlite/src/Lowering/Definition/KeyTermRule.php:76
- instanceof SqlSemantics\Platform\Sqlite\Lowering\Definition\KeyTermRule::expression() packages/sql-semantics-sqlite/src/Lowering/Definition/KeyTermRule.php:82
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Expression\LiteralDefaults::constant() packages/sql-semantics-sqlite/src/Rules/Definition/Expression/LiteralDefaults.php:88
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Expression\LiteralDefaults::core() packages/sql-semantics-sqlite/src/Rules/Definition/Expression/LiteralDefaults.php:105
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\KeyTerms::core() packages/sql-semantics-sqlite/src/Rules/Definition/KeyTerms.php:43
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\KeyTerms::beneath() packages/sql-semantics-sqlite/src/Rules/Definition/KeyTerms.php:55
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ColumnTyping::text() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ColumnTyping.php:88
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::of() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:79
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::adjusted() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:299
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ValueKinds::of() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ValueKinds.php:88
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::spelled() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:163
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\Ordinals::value() packages/sql-semantics-sqlite/src/Rules/Query/Ordinals.php:35
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\Ordinals::value() packages/sql-semantics-sqlite/src/Rules/Query/Ordinals.php:39
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\Projection::items() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:63
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::output() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:87
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::written() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:148
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::inner() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:194
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\SortScopes::word() packages/sql-semantics-sqlite/src/Rules/Query/SortScopes.php:73
- instanceof SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnFacts::denoted() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnFacts.php:69