classResolvedColumn
final class ResolvedColumn
implements Resolution
uses Snapshot
Public API: explicitly declared with
@visibility public.A name that resolves to exactly one output slot of one relation occurrence.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER)');
$query = $semantics->analyze('SELECT a FROM t', [$table]);
$resolution = $query->field('a')->resolution;
[$resolution->relation === $query->inputRelation(), $resolution->declaration() === $table->declarations()[0]->columns[0], $resolution->depth] // => [true, true, 0]Properties§
public Relation $relationpublic OutputSlot $slotpublic int $depth = 0Methods§
public function __construct(
public Relation $relation,
public OutputSlot $slot,
public int $depth = 0,
)Parameters
$relation | Relation | The relation occurrence the name was found in |
$slot | OutputSlot | The output slot of that occurrence |
$depth | int | How many enclosing queries lie between the use and the occurrence; zero for the same query |
Calls 1
- static-call Check::input() line 38
public function declaration(): ?ColumnAnswers the declared column, when the slot is one.
Returns
Calls 1
- method-call OutputSlot::declaration() line 46
Test cases 72§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 69
ColumnLookupTest::testFindAdmitsOnlyTheOccurrenceTheQualifierNamescallsColumnLookupTest::testFindContinuesInTheEnclosingPositionWithAGreaterDepthcallsColumnLookupTest::testFindPrefersTheNearerPositionOverAFartherSlotcallsColumnLookupTest::testFindResolvesTheOnlySlotWithTheNamecallsColumnLookupTest::testFindSkipsHiddenSlotsForAnUnqualifiedNamecallsColumnLookupTest::testFindUsesAnImplicitSlotWhenNoShapeSlotHasTheNamecallsScalarFactTest::testResolutionIsKeptForANameUsecallsQueryTest::testDeriveQueryRecordsTheOutputOfANestedQueryAtItsPositioncallsAmbiguousColumnTest::testMessageIsNotReachedWithFewerThanTwoCandidatescallsResolutionTest::testTheFiveOutcomesAreTheOnlyResolutionscallsFieldTest::testColumnReachesTheDeclarationADirectReferenceReturnscallsPublicationTest::testEstablishDerivesTheFactsAndRendersCorrespondingSqlcallsColumnTypingTest::testResolvedReadsTheRightmostArmThroughADerivedTableAndACommonTablecallsExpressionAffinityTest::testComputingAnswersTheQueryOfADerivedTableOrACommonTablecallsExpressionAffinityTest::testPositionFindsTheOutputFieldASlotReExposescallsExpressionAffinityTest::testResolvedReadsADeclarationADerivedTableAndACommonTablecallsTableShapesTest::testScopeSeesTheRowIdentifierOnlyAtTheRowPositioncallsInsertFactsTest::testDeriveLetsUpsertsSeeTheTargetAndExcludedInTheRightPlacescallsMutationScopeTest::testAssignChecksTheColumnsAndTheWidthOfEachAssignmentcallsTriggerFactsTest::testDeriveHidesTheRowThatTheEventDoesNotProvidecallsTriggerFactsTest::testDeriveMakesTheRowsOfTheEventVisibleByQualifierOnlycallsTriggerFactsTest::testDeriveReportsTriggerOnlyMisusesAndTheColumnsOfUpdateOfcallsProjectionTest::testExpandSkipsTheHiddenColumnsOnlyWhenMergedcallsSelectFactsTest::testDeriveAnswersTheOutputAndRecordsEveryClausecallsSortScopesTest::testDeriveLetsABareAliasWinOnlyWhenAskedTocallsColumnFactsTest::testDenotedAnswersTheOutcomeOfAnUngroupedNameUsecallsColumnFactsTest::testDenotedLooksThroughGroupingsToTheNameUsecallsColumnFactsTest::testOfAnswersTheSlotOfAResolvedColumncallsColumnResolverTest::testFindIsConditionalWhenAnOpenRelationMayHoldTheNamecallsColumnResolverTest::testFindPrefersARelationColumnOverAnAliasAndAnAliasOverOuterScopescallsColumnResolverTest::testFindReportsAmbiguityAndHonoursHiddenAndQualifiedOnlyRelationscallsColumnResolverTest::testFindResolvesUnqualifiedQualifiedAndImplicitNamescallsColumnResolverTest::testMatchAnswersTheInputsTheNameOfAnUnnamedColumnDependsOncallsColumnResolverTest::testMatchFindsSlotsOrImplicitNamesAndOtherwiseAnswersTheMissingInputscallsFromScopeTest::testEnterDerivesEveryOnConditionInTheScopeOfTheWholeChaincallsFromScopeTest::testOpenResolvesTableCallArgumentsAgainstTheTermsToTheLeftcallsCastTest::testDeriveScalarReadsTheTypeNameAndItsArgumentscallsCollateTest::testDeriveScalarKeepsTheTypeAndNullFactAndLeavesTheResolutionToTheOperandcallsColumnUseTest::testDeriveScalarResolvesADeclaredColumnWithItsFactscallsDoubleQuotedWordTest::testDeriveScalarResolvesADeclaredColumncallsGroupedTest::testDeriveScalarKeepsTheTypeAndNullFactAndLeavesTheResolutionToTheOperandcallsBinaryTest::testDeriveScalarRecordsTheFactsOfBothOperandscallsNullTestTest::testDeriveScalarRecordsTheFactOfTheOperandcallsExistsTest::testDeriveScalarDerivesTheQueryInsideTheEnvironmentOfTheExpressioncallsScalarSubqueryTest::testDeriveScalarDerivesTheQueryInsideTheEnvironmentOfTheExpressioncallsTruthWordTest::testDeriveScalarResolvesAColumnNamedTrueOrFalsecallsAssignmentTest::testValueSeesTheRowOfTheTargetcallsConflictTargetTest::testTermsAndPredicateSeeTheTargetTableOnlycallsDeleteTest::testDeriveWithinSeesTheTargetAndTheCommonTablesInTheWhereClausecallsInsertRowsTest::testDeriveWithinLetsDoUpdateSeeTheTableAndExcludedcallsUpdateTest::testDeriveWithinSeesTheTargetAndTheFromTablesInAssignmentsAndWherecallsUpsertTest::testAssignmentsAndPredicateSeeTheTableAndExcludedcallsRandomColumnNameTest::testDescribeIsTheMissingInputOfALookupThatOnlyARandomlyNamedColumnCouldAnswercallsSelectTest::testDeriveQueryLetsWhereSeeInputColumnsBeforeAliasescallsDerivedQueryTest::testDeriveRelationNamesAnUnaliasedExpressionAfterItsTextcallsJoinOnTest::testConditionSeesBothSidesOfTheJoincallsJoinUsingTest::testColumnsResolveToTheLeftSideUnlessQualifiedcallsNestedInputTest::testDeriveRelationRenamesASingleTableByTheAliascallsTableCallTest::testDeriveRelationResolvesArgumentsAgainstTheTablesToTheLeftcallsAlterAddColumnTest::testDeriveStatementDerivesTheConstraintsAgainstTheTableWithTheNewColumncallsColumnCheckTest::testDeriveConstraintResolvesColumnsOfTheTableBeingDefinedcallsColumnCheckTest::testDeriveConstraintSeesTheRowIdentifiercallsGeneratedTest::testDeriveConstraintResolvesColumnsOfTheTableBeingDefinedcallsCreateIndexTest::testDeriveStatementResolvesTheTableAndTheIndexedColumnscallsCreateTableTest::testDeriveStatementBindsAQueryToTheVeryObjectsItDeclarescallsLiteralColumnTest::testDeriveScalarResolvesTheColumnOfTheTableBeingDefinedcallsTableCheckTest::testDeriveConstraintResolvesColumnsAndTheRowIdentifiercallsTablePrimaryKeyTest::testDeriveConstraintResolvesTheKeyColumnscallsCreateTriggerTest::testDeriveStatementResolvesNewAndOldToTheWatchedTablecalls
Relations§
Instantiated in 5
- new SqlSemantics\Platform\Sqlite\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-sqlite/src/Model/Resolution/LookupLevel.php:51
- new SqlSemantics\Platform\Sqlite\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-sqlite/src/Model/Resolution/LookupLevel.php:58
- new SqlSemantics\Platform\Sqlite\Rules\Query\Projection::expand() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:96
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::match() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:127
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::match() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:133
Constant reads 2
- class-const SqlSemantics\Platform\Sqlite\Model\Statement\Reference\Column\AmbiguousColumn::__construct() packages/sql-semantics-sqlite/src/Model/Statement/Reference/Column/AmbiguousColumn.php:36
- class-const SqlSemantics\Platform\Sqlite\Model\Statement\Reference\Column\ConditionalColumn::__construct() packages/sql-semantics-sqlite/src/Model/Statement/Reference/Column/ConditionalColumn.php:52
Type checks 13
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ColumnTyping::text() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ColumnTyping.php:99
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ColumnTyping::field() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ColumnTyping.php:169
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::reference() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:104
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::field() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:123
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ValueKinds::arm() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ValueKinds.php:163
- instanceof SqlSemantics\Platform\Sqlite\Rules\Mutation\GeneratedWrites::rowidTarget() packages/sql-semantics-sqlite/src/Rules/Mutation/GeneratedWrites.php:154
- instanceof SqlSemantics\Platform\Sqlite\Rules\Mutation\GeneratedWrites::supplied() packages/sql-semantics-sqlite/src/Rules/Mutation/GeneratedWrites.php:174
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::spelled() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:159
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\Projection::items() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:64
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::unnamed() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:115
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::resolved() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:133
- instanceof SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnFacts::of() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnFacts.php:44
- instanceof SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::find() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:68
Type declarations 3
- type SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ColumnTyping packages/sql-semantics-sqlite/src/Rules/Definition/Query/ColumnTyping.php:108
- type SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:129
- type SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:119