classLookupLevel
final class LookupLevel
The search of one query position for a column name.
Rule: CORE-COLUMN-LOOKUP-001 (per-position part). A qualifier admits an occurrence by its alias, or, without an alias, by its relation name and the schema the qualifier writes. Within an admitted occurrence the declared slots are searched before the implicit ones. An occurrence whose shape is open, or which has a slot whose name depends on missing inputs, can still own a name it does not visibly have.
Methods§
public function __construct(
Environment $scope,
Name $column,
QualifiedName|null $qualifier,
int $depth,
)Parameters
$scope | Environment | The position searched |
$column | Name | The column name |
$qualifier | QualifiedName|null | The relation qualifier the use wrote |
$depth | int | How many enclosing queries lie between the use and this position |
Calls 5
- method-call LookupLevel::admits() line 45
- function-call
in_arrayline 50 - new ResolvedColumn line 51
- static-call LookupLevel::undecided() line 63
- function-call
array_pushline 66
public static function undecided(VisibleRelation $relation): list<MissingInput>Answers the inputs that leave the names of an occurrence undecided: those of an open shape and of each unnamed slot.
Parameters
$relation | VisibleRelation |
Returns
list<MissingInput>Called from 3
- static-call SqlSemantics\Platform\Sqlite\Model\Resolution\ColumnLookup::conditional() packages/sql-semantics-sqlite/src/Model/Resolution/ColumnLookup.php:69
- static-call SqlSemantics\Platform\Sqlite\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-sqlite/src/Model/Resolution/LookupLevel.php:63
- static-call SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::match() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:138
Calls 1
- function-call
array_pushline 79
public function admits(
Environment $scope,
VisibleRelation $relation,
?QualifiedName $qualifier,
): boolTells whether a qualifier admits an occurrence; no qualifier admits every occurrence.
Parameters
$scope | Environment | |
$relation | VisibleRelation | |
$qualifier | ?QualifiedName |
Returns
boolTest cases 3
public function found(): list<ResolvedColumn>public function open(): list<VisibleRelation>Answers the incompletely known occurrences that can own the name at this position.
Returns
list<VisibleRelation>Test cases 2
Called from 2
Private surface 2§
Implementation details, listed for orientation only.
private list<ResolvedColumn> $found = []private list<VisibleRelation> $open = []Test cases 8§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 8
LookupLevelTest::testAdmitsAnAliasedOccurrenceByItsAliasOnlycallsLookupLevelTest::testAdmitsAPlainOccurrenceByItsNameAndSchemacallsLookupLevelTest::testAdmitsEveryOccurrenceWithoutAQualifiercallsLookupLevelTest::testFoundListsTheMatchingSlotsOfEveryAdmittedOccurrenceAtTheGivenDepthcallsLookupLevelTest::testFoundSearchesImplicitSlotsOnlyWhenNoDeclaredSlotMatchescallsLookupLevelTest::testOpenListsAnOccurrenceWithASlotWhoseNameIsUndecidedcallsLookupLevelTest::testOpenListsTheIncompleteOccurrencesWithoutAMatchcallsLookupLevelTest::testUndecidedCollectsTheMissingInputsOfTheShapeAndOfUnnamedSlotscalls
Relations§
Instantiated in 1
Static calls 2
- static-call SqlSemantics\Platform\Sqlite\Model\Resolution\ColumnLookup::conditional() packages/sql-semantics-sqlite/src/Model/Resolution/ColumnLookup.php:69
- static-call SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::match() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:138
Method calls 3
- method-call SqlSemantics\Platform\Sqlite\Model\Resolution\ColumnLookup::find() packages/sql-semantics-sqlite/src/Model/Resolution/ColumnLookup.php:41
- method-call SqlSemantics\Platform\Sqlite\Model\Resolution\ColumnLookup::find() packages/sql-semantics-sqlite/src/Model/Resolution/ColumnLookup.php:43
- method-call SqlSemantics\Platform\Sqlite\Model\Resolution\ColumnLookup::find() packages/sql-semantics-sqlite/src/Model/Resolution/ColumnLookup.php:50