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\PostgreSql\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 7§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 7
OrderingTest::testGroupPrefersTheInputColumncallsLateralReachTest::testReachedFindsTheBarredRelationOfAResolvedColumncallsColumnCheckTest::testDeriveClauseResolvesTheConditionAgainstTheTablecallsColumnReferenceTest::testDeriveScalarResolvesAQualifiedColumncallsCreateFunctionTest::testDeriveStatementLetColumnsShadowParameterscallsCreateFunctionTest::testDeriveStatementResolvesParametersInTheBodycallsColumnKeyTest::testDeriveScalarResolvesTheColumncalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-postgres/src/Model/Resolution/LookupLevel.php:51
- new SqlSemantics\Platform\PostgreSql\Model\Resolution\LookupLevel::__construct() packages/sql-semantics-postgres/src/Model/Resolution/LookupLevel.php:58
- new SqlSemantics\Platform\PostgreSql\Rules\Query\StarExpansion::expand() packages/sql-semantics-postgres/src/Rules/Query/StarExpansion.php:124
Constant reads 2
- class-const SqlSemantics\Platform\PostgreSql\Model\Statement\Reference\Column\AmbiguousColumn::__construct() packages/sql-semantics-postgres/src/Model/Statement/Reference/Column/AmbiguousColumn.php:36
- class-const SqlSemantics\Platform\PostgreSql\Model\Statement\Reference\Column\ConditionalColumn::__construct() packages/sql-semantics-postgres/src/Model/Statement/Reference/Column/ConditionalColumn.php:52
Type checks 4
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Expression\ColumnFacts::derive() packages/sql-semantics-postgres/src/Rules/Expression/ColumnFacts.php:71
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Resolution\LateralReach::reached() packages/sql-semantics-postgres/src/Rules/Resolution/LateralReach.php:86
- instanceof SqlSemantics\Platform\PostgreSql\Rules\Table\Definition\GeneratedColumns::referenced() packages/sql-semantics-postgres/src/Rules/Table/Definition/GeneratedColumns.php:70
- instanceof SqlSemantics\Platform\PostgreSql\Statement\Query\ExpressionTarget::project() packages/sql-semantics-postgres/src/Statement/Query/ExpressionTarget.php:76