classAliasTarget
final class AliasTarget
implements Resolution
uses Snapshot
Public API: explicitly declared with
@visibility public.A name that resolves to an output field of the same query by its alias.
The reference stays a reference: the aliased expression is not copied to the use position.
$query = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT 1 AS x ORDER BY x');
$query->facts->scalar($query->statement->orderBy[0]->expression)->resolution->field === $query->field('x') // => trueProperties§
public Field $fieldMethods§
Test cases 16§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 14
ResolutionTest::testTheFiveOutcomesAreTheOnlyResolutionscallsCompoundFactsTest::testDeriveCombinesTheArmsAndOrdersByTheNamesOfEveryArmcallsSelectFactsTest::testDeriveAnswersTheOutputAndRecordsEveryClausecallsSortScopesTest::testDeriveLetsABareAliasWinOnlyWhenAskedTocallsSortScopesTest::testDeriveResolvesAnOrdinalAgainstTheProjectionAndReportsARowValuecallsColumnFactsTest::testOfAnswersTheFieldOfAnAliasTargetcallsColumnResolverTest::testFindPrefersARelationColumnOverAnAliasAndAnAliasOverOuterScopescallsColumnUseTest::testDeriveScalarResolvesAResultAliasInTheOrderingcallsDoubleQuotedWordTest::testDeriveScalarResolvesAResultAliascallsCompoundTest::testDeriveQueryOrdersTheCombinedRowsByTheNamesOfEveryArmcallsOutputOrdinalTest::testDeriveScalarCountsTheColumnsOfACompoundcallsOutputOrdinalTest::testDeriveScalarDenotesTheResultColumnAtThePositioncallsSelectTest::testDeriveQueryLetsOrderByPreferABareAliascallsSelectTest::testDeriveQueryLetsWhereSeeInputColumnsBeforeAliasescalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnResolver::find() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnResolver.php:84
- new SqlSemantics\Platform\Sqlite\Statement\Query\Ordering\OutputOrdinal::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Query/Ordering/OutputOrdinal.php:71
Type checks 4
- instanceof SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity::reference() packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:107
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::unnamed() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:116
- instanceof SqlSemantics\Platform\Sqlite\Rules\Query\ResultNames::resolved() packages/sql-semantics-sqlite/src/Rules/Query/ResultNames.php:137
- instanceof SqlSemantics\Platform\Sqlite\Rules\Resolution\ColumnFacts::of() packages/sql-semantics-sqlite/src/Rules/Resolution/ColumnFacts.php:47