classColumnFacts
final class ColumnFacts
Derives the facts of a name from the outcome of its lookup.
Rule: SQLITE-COLUMN-FACT-001. A resolved name has the type and NULL fact of the slot it denotes; a result column alias has those of the result column; a conditional name depends on the missing inputs; a missing or ambiguous name is invalid. Source: https://sqlite.org/lang_expr.html#column_names. Status: Implemented.
Methods§
public function of(Resolution $resolution): ScalarFactAnswers the facts of a lookup outcome.
Parameters
$resolution | Resolution |
Returns
Test cases 4
Called from 4
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\ColumnUse::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/ColumnUse.php:53
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\DoubleQuotedWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/DoubleQuotedWord.php:63
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\TruthWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/TruthWord.php:57
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\LiteralColumn::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Schema/LiteralColumn.php:67
Calls 5
- new ScalarFact line 45
- new Dependent line 51
- class-const Nullability::Dependent() line 51
- static-call Check::invariant() line 53
- new Invalid line 55
public function denoted(Scalar $expression, Environment $environment): ?ResolutionAnswers the name resolution of an expression that is a name use, possibly in parentheses, or null when it is none.
SQLite keeps no node for a grouping: a column in parentheses is that column. The fact of a grouping carries no resolution of its own, so the outcome is looked up for the name use the groupings enclose. A double-quoted word or truth word that names no column is a literal and has no resolution.
Parameters
$expression | Scalar | |
$environment | Environment |
Returns
Test cases 1
Called from 2
Calls 3
- method-call ColumnResolver::find() line 73
- new ColumnResolver line 73
- new Name line 78
Test cases 5§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
ColumnFactsTest::testDenotedAnswersTheOutcomeOfAnUngroupedNameUsecallsColumnFactsTest::testOfAnswersTheFieldOfAnAliasTargetcallsColumnFactsTest::testOfAnswersTheSlotOfAResolvedColumncallsColumnFactsTest::testOfDependsOnTheMissingInputsOfAConditionalColumncallsColumnFactsTest::testOfIsInvalidForAProblemResolutioncalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\Sqlite\Rules\Mutation\GeneratedWrites::rowidTarget() packages/sql-semantics-sqlite/src/Rules/Mutation/GeneratedWrites.php:152
- new SqlSemantics\Platform\Sqlite\Rules\Query\Projection::items() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:63
- new SqlSemantics\Platform\Sqlite\Statement\Expression\ColumnUse::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/ColumnUse.php:53
- new SqlSemantics\Platform\Sqlite\Statement\Expression\DoubleQuotedWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/DoubleQuotedWord.php:63
- new SqlSemantics\Platform\Sqlite\Statement\Expression\TruthWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/TruthWord.php:57
- new SqlSemantics\Platform\Sqlite\Statement\Schema\LiteralColumn::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Schema/LiteralColumn.php:67
Method calls 6
- method-call SqlSemantics\Platform\Sqlite\Rules\Mutation\GeneratedWrites::rowidTarget() packages/sql-semantics-sqlite/src/Rules/Mutation/GeneratedWrites.php:152
- method-call SqlSemantics\Platform\Sqlite\Rules\Query\Projection::items() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:63
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\ColumnUse::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/ColumnUse.php:53
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\DoubleQuotedWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/DoubleQuotedWord.php:63
- method-call SqlSemantics\Platform\Sqlite\Statement\Expression\TruthWord::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/TruthWord.php:57
- method-call SqlSemantics\Platform\Sqlite\Statement\Schema\LiteralColumn::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Schema/LiteralColumn.php:67