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 4
- static-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::conditional() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:69
- static-call SqlSemantics\Platform\MySql\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-mysql/src/Model/Resolution/LookupLevel.php:63
- static-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::undecided() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:223
- static-call SqlSemantics\Platform\MySql\Rules\Query\From\JoinedInput::complete() packages/sql-semantics-mysql/src/Rules/Query/From/JoinedInput.php:68
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
boolpublic function found(): list<ResolvedColumn>Answers the known slots the name denotes at this position.
Returns
list<ResolvedColumn>Called from 3
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:41
- method-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:94
- method-call SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::admitted() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:186
public function open(): list<VisibleRelation>Answers the incompletely known occurrences that can own the name at this position.
Returns
list<VisibleRelation>Called from 3
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:43
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:50
- method-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:95
Private surface 2§
Implementation details, listed for orientation only.
private list<ResolvedColumn> $found = []private list<VisibleRelation> $open = []Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:40
- new SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:93
- new SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::admitted() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:186
Static calls 3
- static-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::conditional() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:69
- static-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::undecided() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:223
- static-call SqlSemantics\Platform\MySql\Rules\Query\From\JoinedInput::complete() packages/sql-semantics-mysql/src/Rules/Query/From/JoinedInput.php:68
Method calls 6
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:41
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:43
- method-call SqlSemantics\Platform\MySql\Model\Resolution\ColumnLookup::find() packages/sql-semantics-mysql/src/Model/Resolution/ColumnLookup.php:50
- method-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:94
- method-call SqlSemantics\Platform\MySql\Rules\ColumnResolver::find() packages/sql-semantics-mysql/src/Rules/ColumnResolver.php:95
- method-call SqlSemantics\Platform\MySql\Rules\Query\Having\ResultReferences::admitted() packages/sql-semantics-mysql/src/Rules/Query/Having/ResultReferences.php:186