classTableInput
final class TableInput
implements NamedRelation
uses Snapshot
Public API: explicitly declared with
@visibility public.One occurrence of a named table, view or common table as query input.
Rule: SQLITE-TABLE-INPUT-001. The shape and the resolution of the name follow SQLITE-TABLE-SHAPE-001. An index choice restricts how SQLite may read the table and changes no row. Source: https://sqlite.org/lang_select.html#the_from_clause, https://sqlite.org/lang_indexedby.html. Status: Implemented.
$input = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('SELECT a FROM main.t AS x')->singleNamedInput();
[$input->name()->schema?->value, $input->name()->name->value, $input->alias()?->value] // => ['main', 't', 'x']Properties§
public QualifiedName $namepublic Name|null $alias = nullpublic IndexChoice|null $index = nullpublic bool $as = trueMethods§
public function __construct(
public QualifiedName $name,
public Name|null $alias = null,
public IndexChoice|null $index = null,
public bool $as = true,
)Parameters
$name | QualifiedName | The relation name |
$alias | Name|null | The correlation name |
$index | IndexChoice|null | The demanded index |
$as | bool | Whether the keyword AS introduces the alias; SQLite names a column after the text of an expression, which includes it |
Throws
InvalidConstruction When AS is left out without an aliasCalls 1
- static-call Check::input() line 46
public function name(): QualifiedNameAnswers the relation name.
Returns
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactResolves the name and derives the row shape of the occurrence.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- method-call TableShapes::fact() line 70
- new TableShapes line 70
public function render(Output $out): voidWrites the name, the correlation name and the index choice.
Parameters
$out | Output |
Calls 6
- method-call Output::name() line 79
- class-const NameUse::Qualifier() line 79
- class-const NameUse::Relation() line 81
- method-call Output::keyword() line 84
- class-const NameUse::Alias() line 86
- method-call Output::node() line 88
Test cases 88§
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 84
NameRuleTest::testNameDecodesAnIdentifierAtANamePositioncallsNameRuleTest::testScopedReadsTheSchemaWhenASecondNameFollowscallsMutationRuleTest::testUpdateLowersEveryClauseInGrammarOrdercallsFromRuleTest::testFromIsNullWithoutTheClausecallsFromRuleTest::testIndexedLowersIndexedByAndNotIndexedcallsFromRuleTest::testTermLowersEachKindOfTermWithItsAliascallsFromRuleTest::testTermsAnswersOneTermWithoutAConstraintAndAChainOtherwisecallsSelectRuleTest::testSelectionLowersEveryClauseInGrammarOrdercallsTriggerRuleTest::testStepLowersAnUpdateWithEveryClausecallsDerivationTest::testRelationRecordsTheFactOfAnOccurrencecallsColumnLookupTest::testConditionalCollectsTheRelationsAndMissingInputsOfEveryOpenOccurrencecallsColumnLookupTest::testFindAdmitsOnlyTheOccurrenceTheQualifierNamescallsColumnLookupTest::testFindContinuesInTheEnclosingPositionWithAGreaterDepthcallsColumnLookupTest::testFindIsAmbiguousForSeveralSlotsAtOnePositioncallsColumnLookupTest::testFindIsConditionalWhileANearerOccurrenceIsIncompletelyKnowncallsColumnLookupTest::testFindIsConditionalWithoutCandidatesWhenNothingIsKnowncallsColumnLookupTest::testFindIsMissingOnlyWhenEverySearchedOccurrenceIsCompletecallsColumnLookupTest::testFindPrefersTheNearerPositionOverAFartherSlotcallsColumnLookupTest::testFindResolvesTheOnlySlotWithTheNamecallsColumnLookupTest::testFindSkipsHiddenSlotsForAnUnqualifiedNamecallsColumnLookupTest::testFindUsesAnImplicitSlotWhenNoShapeSlotHasTheNamecallsLookupLevelTest::testAdmitsAnAliasedOccurrenceByItsAliasOnlycallsLookupLevelTest::testAdmitsAPlainOccurrenceByItsNameAndSchemacallsLookupLevelTest::testAdmitsEveryOccurrenceWithoutAQualifiercallsLookupLevelTest::testFoundListsTheMatchingSlotsOfEveryAdmittedOccurrenceAtTheGivenDepthcallsLookupLevelTest::testFoundSearchesImplicitSlotsOnlyWhenNoDeclaredSlotMatchescallsLookupLevelTest::testOpenListsAnOccurrenceWithASlotWhoseNameIsUndecidedcallsLookupLevelTest::testOpenListsTheIncompleteOccurrencesWithoutAMatchcallsLookupLevelTest::testUndecidedCollectsTheMissingInputsOfTheShapeAndOfUnnamedSlotscallsVisibleRelationTest::testAnOccurrenceWithoutQualifiersIsFoundByUnqualifiedNamesOnlycallsVisibleRelationTest::testTheQualifiersHiddenPositionsAndImplicitSlotsAreKeptcallsResolvedColumnTest::testDeclarationIsNotReachedForANegativeDepthcallsSelectionTest::testInputAnswersTheRelationStructureOrNullcallsPublicationTest::testEstablishDerivesTheFactsAndRendersCorrespondingSqlcallsValueGraphTest::testObjectsRefusesAPhpReferenceInsideAListcallsProjectionTest::testExpandAppendsAnOpenStarForAnIncompleteRelationcallsProjectionTest::testExpandSkipsTheHiddenColumnsOnlyWhenMergedcallsProjectionTest::testItemsReportsAStarWithoutInputAndAQualifierThatNamesNoRelationcallsColumnFactsTest::testDenotedAnswersTheOutcomeOfAnUngroupedNameUsecallsColumnResolverTest::testAdmitsMatchesTheAliasOrTheNameWithAnOptionalSchemacallsColumnResolverTest::testFindIsConditionalWhenAnOpenRelationMayHoldTheNamecallsColumnResolverTest::testFindPrefersARelationColumnOverAnAliasAndAnAliasOverOuterScopescallsColumnResolverTest::testFindReportsAmbiguityAndHonoursHiddenAndQualifiedOnlyRelationscallsColumnResolverTest::testFindResolvesUnqualifiedQualifiedAndImplicitNamescallsColumnResolverTest::testMatchAnswersTheInputsTheNameOfAnUnnamedColumnDependsOncallsColumnResolverTest::testMatchFindsSlotsOrImplicitNamesAndOtherwiseAnswersTheMissingInputscallsFromScopeTest::testEnterDerivesEveryOnConditionInTheScopeOfTheWholeChaincallsFromScopeTest::testEnterReportsConstraintsWithoutAJoinAndInvalidOperatorscallsFromScopeTest::testNestedAddsAQualifiedOnlyRelationForAnAliasedJoincallsFromScopeTest::testNestedRenamesASingleTermByTheAliasOrKeepsItsRelationscallsFromScopeTest::testOpenEntersAChainOrANestedInputAndRecordsItsFactcallsFromScopeTest::testOpenMakesATableVisibleWithItsNameAliasAndRowIdentifiercallsFromScopeTest::testOpenResolvesTableCallArgumentsAgainstTheTermsToTheLeftcallsFromScopeTest::testStarListsTheUnhiddenSlotsOfQualifiableRelationsOnlycallsJoinedInputTest::testFactAndVisibleRelationsAreKeptAsGivencallsJoiningTest::testClosedIsTrueOnlyForCompleteFullyNamedShapescallsJoiningTest::testCoalescedWidensOneSlotAndLinksItsOrigincallsJoiningTest::testExtendMakesEverySlotAndImplicitNullableAndKeepsOriginscallsJoiningTest::testJoinCoalescesTheMergedColumnAndExtendsTheLeftSideOfARightJoincallsJoiningTest::testJoinExtendsTheRightSideOfALeftJoincallsJoiningTest::testJoinHidesTheRightUsingColumnAndKeepsTheLeftSidecallsJoiningTest::testJoinMergesEveryCommonNameOfANaturalJoincallsJoiningTest::testJoinReportsAUsingColumnThatAClosedSideLackscallsJoiningTest::testLocateFindsTheFirstVisibleSlotByNamecallsJoiningTest::testReplacedSwapsOneRelationByPositioncallsUpdateTest::testInputAnswersTheFromRelationcallsListedColumnTest::testRenderWritesANewlyBuiltNamecallsSortTermTest::testRenderWritesANewlyBuiltTermcallsSelectTest::testInputIsTheFromRelationcallsSelectTest::testRenderWritesANewlyBuiltSelectioncallsTableStarTest::testRenderWritesANewlyBuiltQualifiedStarAndReportsAnUnknownQualifiercallsCommonTableTest::testRenderWritesANewlyBuiltTablecallsWithQueryTest::testRenderWritesANewlyBuiltQuerycallsIndexChoiceTest::testRenderWritesIndexedByWithTheIndexNamecallsIndexChoiceTest::testRenderWritesNotIndexedWhenNoIndexIsNamedcallsJoinChainTest::testRejectsAChainAsTheFirstTermcallsJoinChainTest::testRejectsASingleTermWithoutAConstraintcallsJoinChainTest::testRenderWritesTheFirstTermItsConstraintAndEachStepcallsJoinOnTest::testRenderWritesOnBeforeTheConditioncallsJoinStepTest::testRejectsAJoinChainAsTheJoinedRelationcallsJoinStepTest::testRenderWritesOperatorRelationAndConstraintcallsJoinUsingTest::testRenderWritesTheColumnsInParenthesescallsNestedInputTest::testRenderRefusesToLeaveOutAsWithoutAnAliascallsNestedInputTest::testRenderWritesParenthesesAndTheAliascalls