classRowShape
final class RowShape
uses Snapshot
Public API: explicitly declared with
@visibility public.The ordered output positions of a relation occurrence or query.
A shape is open when missing inputs prevent listing every position. The known positions are then still exact, but more may exist.
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER, b TEXT)');
$operation = $semantics->analyze('SELECT * FROM t', [$table]);
[$operation->shape()->complete(), count($operation->shape()->slots)] // => [true, 2]Properties§
public list<OutputSlot> $slotspublic list<MissingInput> $missingMethods§
public function __construct(list<OutputSlot> $slots, list<MissingInput> $missing = [])Parameters
$slots | list<OutputSlot> | The known positions in order |
$missing | list<MissingInput> | The inputs whose absence leaves the shape open |
Calls 3
- static-call Check::listOf() line 44
- class-const OutputSlot::class() line 44
- class-const MissingInput::class() line 45
public function complete(): boolTells whether every output position is listed.
Returns
boolTest cases 2
Test cases 43§
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 41
DerivationTest::testTableResolvesTheNearestCommonTableBeforeTheContextcallsDerivationTest::testTargetRecordsATableUseThatIsNoRelationAndItsDiagnosticcallsColumnLookupTest::testConditionalCollectsTheRelationsAndMissingInputsOfEveryOpenOccurrencecallsColumnLookupTest::testFindAdmitsOnlyTheOccurrenceTheQualifierNamescallsColumnLookupTest::testFindContinuesInTheEnclosingPositionWithAGreaterDepthcallsColumnLookupTest::testFindIsAmbiguousForSeveralSlotsAtOnePositioncallsColumnLookupTest::testFindIsConditionalWhileANearerOccurrenceIsIncompletelyKnowncallsColumnLookupTest::testFindIsConditionalWithoutCandidatesWhenNothingIsKnowncallsColumnLookupTest::testFindIsMissingOnlyWhenEverySearchedOccurrenceIsCompletecallsColumnLookupTest::testFindPrefersTheNearerPositionOverAFartherSlotcallsColumnLookupTest::testFindResolvesTheOnlySlotWithTheNamecallsColumnLookupTest::testFindSkipsHiddenSlotsForAnUnqualifiedNamecallsColumnLookupTest::testFindUsesAnImplicitSlotWhenNoShapeSlotHasTheNamecallsCommonBindingTest::testABindingTiesANameToItsDefinitionAndShapecallsEnvironmentTest::testCommonTableComparesNamesAsTheContextSayscallsEnvironmentTest::testCommonTableFindsTheNearestBindingWithLaterOnesShadowingEarlierOnescallsLookupLevelTest::testAdmitsAnAliasedOccurrenceByItsAliasOnlycallsLookupLevelTest::testAdmitsAPlainOccurrenceByItsNameAndSchemacallsLookupLevelTest::testAdmitsEveryOccurrenceWithoutAQualifiercallsLookupLevelTest::testFoundListsTheMatchingSlotsOfEveryAdmittedOccurrenceAtTheGivenDepthcallsLookupLevelTest::testFoundSearchesImplicitSlotsOnlyWhenNoDeclaredSlotMatchescallsLookupLevelTest::testOpenListsAnOccurrenceWithASlotWhoseNameIsUndecidedcallsLookupLevelTest::testOpenListsTheIncompleteOccurrencesWithoutAMatchcallsLookupLevelTest::testUndecidedCollectsTheMissingInputsOfTheShapeAndOfUnnamedSlotscallsVisibleRelationTest::testAnOccurrenceWithoutQualifiersIsFoundByUnqualifiedNamesOnlycallsVisibleRelationTest::testTheQualifiersHiddenPositionsAndImplicitSlotsAreKeptcallsRelationFactTest::testTableDefaultsToNullOnConstructioncallsValueGraphTest::testObjectsRefusesAPhpReferenceInsideAListcallsCompoundFactsTest::testReboundGivesTheRecursiveReferenceTheNamesOfTheColumnListAndAnyStorageClasscallsCompoundFactsTest::testReboundNamesTheColumnsAfterTheFirstArmWithoutAColumnListcallsProjectionTest::testExpandAppendsAnOpenStarForAnIncompleteRelationcallsProjectionTest::testExpandSkipsTheHiddenColumnsOnlyWhenMergedcallsProjectionTest::testItemsReportsAStarWithoutInputAndAQualifierThatNamesNoRelationcallsColumnResolverTest::testAdmitsMatchesTheAliasOrTheNameWithAnOptionalSchemacallsColumnResolverTest::testMatchAnswersTheInputsTheNameOfAnUnnamedColumnDependsOncallsColumnResolverTest::testMatchFindsSlotsOrImplicitNamesAndOtherwiseAnswersTheMissingInputscallsJoinedInputTest::testFactAndVisibleRelationsAreKeptAsGivencallsJoiningTest::testClosedIsTrueOnlyForCompleteFullyNamedShapescallsJoiningTest::testCoalescedWidensOneSlotAndLinksItsOrigincallsJoiningTest::testReplacedSwapsOneRelationByPositioncallsTableShapesTest::testFactCopiesTheShapeOfACommonTableAndLinksItsSlotscalls
Relations§
Instantiated in 21
- new SqlSemantics\Platform\Sqlite\Model\Statement\Fact\QueryFact::__construct() packages/sql-semantics-sqlite/src/Model/Statement/Fact/QueryFact.php:67
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::shape() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:53
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::target() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:85
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::target() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:88
- new SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes::implicitOf() packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:98
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::provisional() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:122
- new SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables::shape() packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:151
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::derive() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:81
- new SqlSemantics\Platform\Sqlite\Rules\Query\CompoundFacts::rebound() packages/sql-semantics-sqlite/src/Rules/Query/CompoundFacts.php:185
- new SqlSemantics\Platform\Sqlite\Rules\Query\RelationNames::shape() packages/sql-semantics-sqlite/src/Rules/Query/RelationNames.php:85
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\FromScope::star() packages/sql-semantics-sqlite/src/Rules/Resolution/FromScope.php:149
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining::coalesced() packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:101
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\Joining::extend() packages/sql-semantics-sqlite/src/Rules/Resolution/Joining.php:165
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:52
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:60
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:63
- new SqlSemantics\Platform\Sqlite\Rules\Resolution\TableShapes::fact() packages/sql-semantics-sqlite/src/Rules/Resolution/TableShapes.php:66
- new SqlSemantics\Platform\Sqlite\Statement\Expression\Subquery\InTable::deriveScalar() packages/sql-semantics-sqlite/src/Statement/Expression/Subquery/InTable.php:84
- new SqlSemantics\Platform\Sqlite\Statement\Relation\TableCall::deriveRelation() packages/sql-semantics-sqlite/src/Statement/Relation/TableCall.php:75
- new SqlSemantics\Platform\Sqlite\Statement\Schema\AlterAddColumn::deriveRelation() packages/sql-semantics-sqlite/src/Statement/Schema/AlterAddColumn.php:83
- new SqlSemantics\Platform\Sqlite\Statement\Schema\Drop::deriveStatement() packages/sql-semantics-sqlite/src/Statement/Schema/Drop.php:68
Method calls 1
Type declarations 13
- type SqlSemantics\Platform\Sqlite\Model\Resolution\CommonBinding packages/sql-semantics-sqlite/src/Model/Resolution/CommonBinding.php:23
- type SqlSemantics\Platform\Sqlite\Model\Resolution\VisibleRelation packages/sql-semantics-sqlite/src/Model/Resolution/VisibleRelation.php:34
- type SqlSemantics\Platform\Sqlite\Model\Statement\Fact\QueryFact packages/sql-semantics-sqlite/src/Model/Statement/Fact/QueryFact.php:42
- type SqlSemantics\Platform\Sqlite\Model\Statement\Fact\RelationFact packages/sql-semantics-sqlite/src/Model/Statement/Fact/RelationFact.php:29
- type SqlSemantics\Platform\Sqlite\Model\Statement\Operation packages/sql-semantics-sqlite/src/Model/Statement/Operation.php:99
- type SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:46
- type SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:61
- type SqlSemantics\Platform\Sqlite\Rules\Definition\TableShapes packages/sql-semantics-sqlite/src/Rules/Definition/TableShapes.php:109
- type SqlSemantics\Platform\Sqlite\Rules\Mutation\GeneratedWrites packages/sql-semantics-sqlite/src/Rules/Mutation/GeneratedWrites.php:63
- type SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:115
- type SqlSemantics\Platform\Sqlite\Rules\Query\CommonTables packages/sql-semantics-sqlite/src/Rules/Query/CommonTables.php:128
- type SqlSemantics\Platform\Sqlite\Rules\Query\RelationNames packages/sql-semantics-sqlite/src/Rules/Query/RelationNames.php:56
- type SqlSemantics\Platform\Sqlite\Rules\Resolution\FromScope packages/sql-semantics-sqlite/src/Rules/Resolution/FromScope.php:133