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\MySql\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 44§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 44
ColumnResolverTest::testFactAnswersTheFactsOfTheColumnOrTheProblemcallsColumnResolverTest::testFindPrefersAColumnOfTheFromClauseToAnAliascallsColumnResolverTest::testRowTellsWhetherATriggerRowIsVisiblecallsInsertFactsTest::testSetDerivesTheAssignmentscallsHavingScopeTest::testGroupingAnswersTheColumnsAsTheHavingPositionSeesThemcallsHavingScopeTest::testLeaveLetsTheArgumentsOfASetFunctionSeeTheColumnscallsResultReferencesTest::testAdmittedTellsWhetherTheQualifierFindsTheColumncallsResultReferencesTest::testChosenPrefersTheAliasedMatchAndReportsTwoDifferentUnaliasedOnescallsResultReferencesTest::testDeeperCountsTheQueriesBetweenTheUseAndTheColumncallsResultReferencesTest::testFindPrefersAGroupByColumnToASelectListItemcallsResultReferencesTest::testGroupingSkipsAColumnOfAnotherOccurrenceAndReportsTwoDifferentColumnscallsResultReferencesTest::testNamedComparesTheColumnNameByTheColumnComparisonOfTheContextcallsResultReferencesTest::testSameComparesTheOccurrenceAndTheSlotcallsResultReferencesTest::testSelectedResolvesAColumnItemToItsColumnAndAnotherItemToTheItemcallsResultReferencesTest::testUnaliasedMatchesAColumnItemByItsColumnInAnAdmittedOccurrencecallsSortScopesTest::testDeriveResolvesOrdinalsAliasesAndColumnscallsBlockFactsTest::testDeriveDerivesTheCursorQueryInTheScopeOfTheBlockcallsBlockFactsTest::testDeriveResolvesTheVariableOfTheInnermostBlockcallsBlockFactsTest::testVariablesHidesAParameterOfTheSameNamecallsBlockFactsTest::testVariablesReportsADuplicateNameAndKeepsTheFirstMeaningcallsBodyFactsTest::testStatementResolvesAVariableInANestedQuerycallsBodyFactsTest::testStatementResolvesAVariableInAnInspectedStatementcallsConditionFactsTest::testSignalResolvesTheValueOfAnItemToAParametercallsFlowFactsTest::testBranchesResolvesAVariableInTheConditioncallsFlowFactsTest::testLoopResolvesAVariableInTheConditioncallsFlowFactsTest::testReturnedResolvesTheValueToALocalVariablecallsRowAliasesTest::testVisibleResolvesTheOldRowToTheTriggerTablecallsLoadTableTest::testDeriveStatementResolvesColumnsAndAssignmentscallsUpdateTest::testDeriveStatementResolvesAssignmentsAgainstEveryTablecallsColumnUseTest::testDeriveScalarAnswersTheTypeAndNullFactOfTheResolvedSlotcallsColumnUseTest::testDeriveScalarResolvesWithoutRegardToLetterCasecallsLateOrderingTest::testRenderWritesTheOrderingAfterTheLockingClausesOfTheBlockcallsSelectExpressionTest::testDeriveNamesTheColumnsOfACommonTableAndOfAUnionAfterTheFirstOperandcallsSelectExpressionTest::testDeriveNamesTheColumnsOfADerivedTableAfterTheirTextcallsSelectTest::testDeriveQueryDerivesThePredicateInTheScopeOfTheTablecallsSelectTest::testDeriveQueryNamesTheFieldsAfterAliasesAndColumnscallsBlockTest::testDeriveProgramHidesAParameterWithAVariableOfTheSameNamecallsBlockTest::testDeriveProgramKeepsTheFirstMeaningOfADuplicateVariablecallsReturnStatementTest::testDeriveProgramResolvesTheParametercallsColumnDefinitionTest::testDeriveElementDerivesTheSpecificationInTheTablecallsDefaultExpressionTest::testDeriveAttributeResolvesColumnsOfTheTablecallsCreateIndexTest::testDeriveStatementResolvesTheKeyPartsInTheTablecallsCreateTableTest::testDeriveStatementDerivesTheElementsInTheTablecallsExpressionPartTest::testDeriveKeyPartResolvesTheExpressionInTheTablecalls
Relations§
Instantiated in 6
- new SqlSemantics\Platform\MySql\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-mysql/src/Model/Resolution/LookupLevel.php:51
- new SqlSemantics\Platform\MySql\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-mysql/src/Model/Resolution/LookupLevel.php:58
- new SqlSemantics\Platform\MySql\Rules\Query\Having\HavingScope::grouping() packages/sql-semantics-mysql/src/Rules/Query/Having/HavingScope.php:75
- new SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::deeper() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:208
- new SqlSemantics\Platform\MySql\Rules\Query\Projection::field() packages/sql-semantics-mysql/src/Rules/Query/Projection.php:149
- new SqlSemantics\Platform\MySql\Rules\Query\TableShapes::explicit() packages/sql-semantics-mysql/src/Rules/Query/TableShapes.php:97
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Model\Statement\Reference\Column\AmbiguousColumn::__construct() packages/sql-semantics-mysql/src/Model/Statement/Reference/Column/AmbiguousColumn.php:36
- class-const SqlSemantics\Platform\MySql\Model\Statement\Reference\Column\ConditionalColumn::__construct() packages/sql-semantics-mysql/src/Model/Statement/Reference/Column/ConditionalColumn.php:52
Type checks 14
- instanceof SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:85
- instanceof SqlSemantics\Platform\MySql\Rules\ColumnResolver::fact() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:123
- instanceof SqlSemantics\Platform\MySql\Rules\Dml\ChangeFacts::update() packages/sql-semantics-mysql/src/Rules/Dml/ChangeFacts.php:67
- instanceof SqlSemantics\Platform\MySql\Rules\Dml\GeneratedWrites::assignments() packages/sql-semantics-mysql/src/Rules/Dml/GeneratedWrites.php:84
- instanceof SqlSemantics\Platform\MySql\Rules\Dml\WriteScope::field() packages/sql-semantics-mysql/src/Rules/Dml/WriteScope.php:43
- instanceof SqlSemantics\Platform\MySql\Rules\Dml\WriteScope::distinct() packages/sql-semantics-mysql/src/Rules/Dml/WriteScope.php:92
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\HavingScope::grouping() packages/sql-semantics-mysql/src/Rules/Query/Having/HavingScope.php:69
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::grouping() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:68
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::selected() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:97
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::selected() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:100
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::undecided() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:128
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::unnamed() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:140
- instanceof SqlSemantics\Platform\MySql\Rules\Query\Projection::items() packages/sql-semantics-mysql/src/Rules/Query/Projection.php:58
- instanceof SqlSemantics\Platform\MySql\Rules\Routine\ProgramScope::variable() packages/sql-semantics-mysql/src/Rules/Routine/ProgramScope.php:79
Type declarations 6
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:155
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:163
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:176
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:184
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:198
- type SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:206