classOutputSlot
final class OutputSlot
uses Snapshot
Public API: explicitly declared with
@visibility public.One output position of a relation occurrence or of a query.
A slot is not a declaration. A slot of a named table refers to the declared column; a slot a join re-exposes refers to the input slot it comes from and carries its own NULL fact, so an outer join never changes a declaration.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER NOT NULL)');
$semantics->analyze('SELECT a FROM t', [$table])->field('a')->slot->nullability // => \SqlSemantics\Platform\Sqlite\Model\Statement\Type\Nullability::NotNullProperties§
public list<MissingInput> $unnamedpublic Name|null $namepublic TypeFact $typepublic Nullability $nullabilitypublic Column|null $column = nullpublic OutputSlot|null $origin = nullMethods§
public function __construct(
public Name|null $name,
public TypeFact $type,
public Nullability $nullability,
public Column|null $column = null,
public OutputSlot|null $origin = null,
list<MissingInput> $unnamed = [],
)Parameters
$name | Name|null | The output name, or null when the position has none |
$type | TypeFact | What is known about the type at this position |
$nullability | Nullability | Whether the position can be NULL |
$column | Column|null | The declared column when the position is that column itself |
$origin | OutputSlot|null | The input slot this position re-exposes, for example through a join |
$unnamed | list<MissingInput> | The inputs whose absence leaves the name of an unnamed position undecided; empty when it has no name at all |
Calls 3
- static-call Check::listOf() line 53
- class-const MissingInput::class() line 53
- static-call Check::input() line 54
public function declaration(): ?ColumnFollows re-exposed slots back to the declared column, when the position is one.
Returns
Test cases 2
Called from 2
- method-call SqlSemantics\Platform\Sqlite\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-sqlite/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\Sqlite\Model\Statement\Shape\Field::column() packages/sql-semantics-sqlite/src/Model/Statement/Shape/Field.php:69
Test cases 63§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 59
ColumnLookupTest::testFindAdmitsOnlyTheOccurrenceTheQualifierNamescallsColumnLookupTest::testFindContinuesInTheEnclosingPositionWithAGreaterDepthcallsColumnLookupTest::testFindIsAmbiguousForSeveralSlotsAtOnePositioncallsColumnLookupTest::testFindIsConditionalWhileANearerOccurrenceIsIncompletelyKnowncallsColumnLookupTest::testFindIsMissingOnlyWhenEverySearchedOccurrenceIsCompletecallsColumnLookupTest::testFindPrefersTheNearerPositionOverAFartherSlotcallsColumnLookupTest::testFindResolvesTheOnlySlotWithTheNamecallsColumnLookupTest::testFindSkipsHiddenSlotsForAnUnqualifiedNamecallsColumnLookupTest::testFindUsesAnImplicitSlotWhenNoShapeSlotHasTheNamecallsCommonBindingTest::testABindingTiesANameToItsDefinitionAndShapecallsEnvironmentTest::testAliasedFindsEveryOutputFieldWithTheAliascallsImplicitSlotTest::testEveryNameLeadsToTheOneSlotcallsLookupLevelTest::testFoundListsTheMatchingSlotsOfEveryAdmittedOccurrenceAtTheGivenDepthcallsLookupLevelTest::testFoundSearchesImplicitSlotsOnlyWhenNoDeclaredSlotMatchescallsLookupLevelTest::testOpenListsAnOccurrenceWithASlotWhoseNameIsUndecidedcallsLookupLevelTest::testOpenListsTheIncompleteOccurrencesWithoutAMatchcallsLookupLevelTest::testUndecidedCollectsTheMissingInputsOfTheShapeAndOfUnnamedSlotscallsVisibleRelationTest::testTheQualifiersHiddenPositionsAndImplicitSlotsAreKeptcallsQueryFactTest::testFieldsIsNullWhileAStarCannotBeExpandedcallsQueryFactTest::testFieldsListsACompleteProjectionInOrdercallsQueryFactTest::testLookupDistinguishesUniqueAndAbsentInACompleteShapecallsQueryFactTest::testLookupIsDependentInAnOpenShapeEvenWhenACandidateIsKnowncallsQueryFactTest::testLookupIsNotReachedForAProjectionThatIsNoListcallsResolvedColumnTest::testDeclarationIsNotReachedForANegativeDepthcallsAmbiguousFieldsTest::testFieldsAreAtLeastTwocallsFieldsTest::testAtAnswersTheFieldAtAPositioncallsFieldsTest::testAtRefusesAPositionOutsideTheListcallsFieldsTest::testCountIsTheNumberOfOutputPositionscallsFieldsTest::testGetIteratorWalksTheFieldsInOutputOrdercallsFieldsTest::testLookupIsDependentWhileAFieldNameDependsOnMissingInputscallsFieldsTest::testLookupIsNotReachedWhenAFieldHoldsAnotherPositioncallsFieldsTest::testLookupIsSensitiveWhenTheProfileSaysSocallsFieldsTest::testLookupTellsOneNoneAndSeveralApartcallsRowShapeTest::testCompleteFailsWhileAnInputIsMissingAndTheKnownSlotsStayExactcallsRowShapeTest::testCompleteHoldsWhenNoInputIsMissingcallsRowShapeTest::testCompleteOfAnAnalyzedStarOverDeclaredTablescallsInsertFactsTest::testDeriveBindsTheWithClauseAndReturnsTheTargetRowcallsMutationScopeTest::testReturningIsNullWithoutColumnsAndProjectsTheTargetOtherwisecallsCommonTablesTest::testBindMakesEveryTableVisibleWhateverTheWrittenOrdercallsCommonTablesTest::testProvisionalHasOneSlotPerListedColumnThatCanHoldAnythingcallsCommonTablesTest::testShapeKeepsTheQueryNamesWithoutAListAndReportsADecoratedNamecallsCommonTablesTest::testShapeRenamesTheColumnsByTheListAndReportsAnotherLengthcallsCompoundFactsTest::testReboundGivesTheRecursiveReferenceTheNamesOfTheColumnListAndAnyStorageClasscallsProjectionTest::testExpandAppendsAnOpenStarForAnIncompleteRelationcallsProjectionTest::testExpandSkipsTheHiddenColumnsOnlyWhenMergedcallsProjectionTest::testItemsReportsAStarWithoutInputAndAQualifierThatNamesNoRelationcallsRelationNamesTest::testShapeKeepsAnUndecidedNameAndTheNamesAfterItDependentcallsRelationNamesTest::testShapeKeepsTheMissingInputsAndLeavesTheNamesAfterAnOpenStarUnnamedcallsRelationNamesTest::testShapeLetsAnAliasWinAndCountsItAmongTheDuplicatescallsRelationNamesTest::testShapeNamesTheColumnsAsSqliteDoesBeforeResolutioncallsColumnResolverTest::testFindPrefersARelationColumnOverAnAliasAndAnAliasOverOuterScopescallsColumnResolverTest::testMatchAnswersTheInputsTheNameOfAnUnnamedColumnDependsOncallsColumnResolverTest::testMatchFindsSlotsOrImplicitNamesAndOtherwiseAnswersTheMissingInputscallsFromScopeTest::testStarListsTheUnhiddenSlotsOfQualifiableRelationsOnlycallsJoiningTest::testClosedIsTrueOnlyForCompleteFullyNamedShapescallsJoiningTest::testCoalescedWidensOneSlotAndLinksItsOrigincallsJoiningTest::testExtendMakesEverySlotAndImplicitNullableAndKeepsOriginscallsTableShapesTest::testFactAnswersTheDeclaredShapeWithItsColumnscallsTableShapesTest::testFactCopiesTheShapeOfACommonTableAndLinksItsSlotscalls
Relations§
Instantiated in 20
- new SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems::slot() packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:82
- new SqlSemantics\Platform\Sqlite\Rules\Definition\ExplainRows::fact() packages/sql-semantics-sqlite/src/Rules/Definition/ExplainRows.php:70
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::shape() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:50
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::implicit() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:68
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::provisional() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:119
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::shape() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:144
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::shape() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:145
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::combined() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:121
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::aliases() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:145
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::rebound() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:183
- new SqlSemantics\Platform\Sqlite\Rules\Query\Projection::items() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:66
- new SqlSemantics\Platform\Sqlite\Rules\Query\Projection::expand() packages/sql-semantics-sqlite/src/Rules/Query/Projection.php:96
- new SqlSemantics\Platform\Sqlite\Rules\Query\RelationNames::shape() packages/sql-semantics-sqlite/src/Rules/Query/RelationNames.php:82
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining::coalesced() packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:98
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining::extend() packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:159
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining::extend() packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:163
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:49
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:57
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::implicit() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:78
- new SqlSemantics\Platform\Sqlite\Statement\Query\ValuesClause::deriveQuery() packages/sql-semantics-sqlite/src/Statement/Query/ValuesClause.php:90
Method calls 2
- method-call SqlSemantics\Platform\Sqlite\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-sqlite/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\Sqlite\Model\Statement\Shape\Field::column() packages/sql-semantics-sqlite/src/Model/Statement/Shape/Field.php:69
Constant reads 1
Type declarations 6
- type SqlSemantics\Platform\Sqlite\Model\Resolution\ImplicitSlot packages/sql-semantics-sqlite/src/Model/Resolution/ImplicitSlot.php:21
- type SqlSemantics\Platform\Sqlite\Model\Statement\Reference\Column\ResolvedColumn packages/sql-semantics-sqlite/src/Model/Statement/Reference/Column/ResolvedColumn.php:35
- type SqlSemantics\Platform\Sqlite\Model\Statement\Shape\Field packages/sql-semantics-sqlite/src/Model/Statement/Shape/Field.php:55
- type SqlSemantics\Platform\Sqlite\Rules\Definition\AlterationProblems packages/sql-semantics-sqlite/src/Rules/Definition/AlterationProblems.php:80
- type SqlSemantics\Platform\Sqlite\Rules\Definition\Query\ExpressionAffinity packages/sql-semantics-sqlite/src/Rules/Definition/Query/ExpressionAffinity.php:177
- type SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:94