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\PostgreSql\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER NOT NULL)');
$semantics->analyze('SELECT a FROM t', [$table])->field('a')->slot->nullability // => \SqlSemantics\Platform\PostgreSql\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
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-postgres/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Shape\Field::column() packages/sql-semantics-postgres/src/Model/Statement/Shape/Field.php:69
Test cases 34§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 34
ColumnFactsTest::testAliasReportsSeveralOutputColumnscallsColumnFactsTest::testDeriveRefersToAnOutputColumnByNamecallsOperandChecksTest::testFieldsReadsTheFieldsOfRowscallsSublinksTest::testArrayIsAnArrayOfTheColumnTypecallsSublinksTest::testValueIsARowForSeveralColumnscallsSubscriptingTest::testFieldReadsTheSlotOfACompositecallsOrderingTest::testKnownStopsAtAnOpenStarcallsOrderingTest::testPositionsListsTheKnownFieldscallsOrderingTest::testSameComparesTheExpressionscallsUnknownOutputsTest::testRawKeepsAnUntypedLiteralUnknowncallsFunctionShapesTest::testPaddedMakesSlotsNullablecallsJoiningTest::testExtendedMakesEverySlotNullablecallsJoiningTest::testNullableKeepsTheSlotItExtendscallsLateralReachTest::testBarMarksEveryRelationOncecallsLateralReachTest::testBarredTellsABarredRelationcallsLateralReachTest::testReachedFindsTheBarredRelationOfAQualifiercallsLateralReachTest::testReachedFindsTheBarredRelationOfAResolvedColumncallsVisibilityTest::testAdmitsMatchesTheNameAndSchemacallsVisibilityTest::testQualifiedOnlyHidesEverySlotcallsVisibilityTest::testRestrictedTellsAQualifiedOnlyRelationcallsVisibilityTest::testStarSkipsQualifiedOnlyRelationscallsVisibilityTest::testUnhiddenSkipsHiddenSlotscallsVisibilityTest::testUnqualifiedDropsTheSystemColumnsOfQualifiedOnlyRelationscallsVisibilityTest::testUnqualifiedKeepsAnEnvironmentWithoutQualifiedOnlyRelationscallsColumnReferenceTest::testDeriveScalarReadsAOneWordNameAsTheWholeRowOfARelationcallsColumnReferenceTest::testDeriveScalarResolvesAQualifiedColumncallsColumnStarTest::testDeriveScalarIsTheWholeRowOfTheRelationcallsRowConstructorTest::testDeriveScalarIsARecordOfTheFieldscallsArraySubqueryTest::testDeriveScalarIsAnArrayOfTheColumnTypecallsExistsTest::testDeriveScalarIsANonNullBooleancallsInSubqueryTest::testDeriveScalarComparesWithTheColumncallsQuantifiedSubqueryTest::testDeriveScalarComparesWithTheColumncallsScalarSubqueryTest::testDeriveScalarHasTheColumnTypeAndCanBeNullcallsUniquePredicateTest::testDeriveScalarReportsThePredicatecalls
Relations§
Instantiated in 45
- new SqlSemantics\Platform\PostgreSql\Rules\Access\GrantedRelations::derive() packages/sql-semantics-postgres/src/Rules/Access/GrantedRelations.php:58
- new SqlSemantics\Platform\PostgreSql\Rules\Catalog\DomainInput::environment() packages/sql-semantics-postgres/src/Rules/Catalog/DomainInput.php:49
- new SqlSemantics\Platform\PostgreSql\Rules\Catalog\PublishedTables::derive() packages/sql-semantics-postgres/src/Rules/Catalog/PublishedTables.php:54
- new SqlSemantics\Platform\PostgreSql\Rules\Manipulation\MergeFacts::nullable() packages/sql-semantics-postgres/src/Rules/Manipulation/MergeFacts.php:140
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:185
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:190
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:194
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\CommonTableFacts::shape() packages/sql-semantics-postgres/src/Rules/Query/Facts/CommonTableFacts.php:195
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SelectFacts::grouped() packages/sql-semantics-postgres/src/Rules/Query/Facts/SelectFacts.php:186
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SetOperationFacts::combined() packages/sql-semantics-postgres/src/Rules/Query/Facts/SetOperationFacts.php:84
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\SetOperationFacts::rebound() packages/sql-semantics-postgres/src/Rules/Query/Facts/SetOperationFacts.php:102
- new SqlSemantics\Platform\PostgreSql\Rules\Query\Facts\ValuesFacts::derive() packages/sql-semantics-postgres/src/Rules/Query/Facts/ValuesFacts.php:61
- new SqlSemantics\Platform\PostgreSql\Rules\Query\StarExpansion::expand() packages/sql-semantics-postgres/src/Rules/Query/StarExpansion.php:124
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\ColumnAliases::apply() packages/sql-semantics-postgres/src/Rules/Resolution/ColumnAliases.php:49
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\ColumnAliases::apply() packages/sql-semantics-postgres/src/Rules/Resolution/ColumnAliases.php:52
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\ColumnAliases::fromQuery() packages/sql-semantics-postgres/src/Rules/Resolution/ColumnAliases.php:66
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::derive() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:81
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::derive() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:88
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::defined() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:116
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\FunctionShapes::padded() packages/sql-semantics-postgres/src/Rules/Resolution/FunctionShapes.php:132
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::join() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:64
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::merged() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:175
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining::nullable() packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:183
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::xml() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:69
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::xml() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:73
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::columns() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:153
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes::typed() packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:183
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableShapes::input() packages/sql-semantics-postgres/src/Rules/Resolution/TableShapes.php:67
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableShapes::input() packages/sql-semantics-postgres/src/Rules/Resolution/TableShapes.php:78
- new SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableShapes::implicit() packages/sql-semantics-postgres/src/Rules/Resolution/TableShapes.php:97
- new SqlSemantics\Platform\PostgreSql\Rules\Routine\RelationTargets::record() packages/sql-semantics-postgres/src/Rules/Routine/RelationTargets.php:105
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Command\Alterations::widened() packages/sql-semantics-postgres/src/Rules/Table/Command/Alterations.php:126
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Targets::shape() packages/sql-semantics-postgres/src/Rules/Table/Targets.php:87
- new SqlSemantics\Platform\PostgreSql\Rules\Table\Targets::implicit() packages/sql-semantics-postgres/src/Rules/Table/Targets.php:103
- new SqlSemantics\Platform\PostgreSql\Rules\Utility\ExplainFacts::rows() packages/sql-semantics-postgres/src/Rules/Utility/ExplainFacts.php:75
- new SqlSemantics\Platform\PostgreSql\Statement\Expression\Constructor\RowConstructor::deriveScalar() packages/sql-semantics-postgres/src/Statement/Expression/Constructor/RowConstructor.php:76
- new SqlSemantics\Platform\PostgreSql\Statement\Manipulation\Prepared\PreparedParameters::deriveRelation() packages/sql-semantics-postgres/src/Statement/Manipulation/Prepared/PreparedParameters.php:69
- new SqlSemantics\Platform\PostgreSql\Statement\Query\ExpressionTarget::project() packages/sql-semantics-postgres/src/Statement/Query/ExpressionTarget.php:78
- new SqlSemantics\Platform\PostgreSql\Statement\Routine\RoutineParameters::deriveRelation() packages/sql-semantics-postgres/src/Statement/Routine/RoutineParameters.php:66
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:62
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:63
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:64
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:66
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:67
- new SqlSemantics\Platform\PostgreSql\Statement\Utility\Session\Show::deriveStatement() packages/sql-semantics-postgres/src/Statement/Utility/Session/Show.php:68
Method calls 2
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-postgres/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\PostgreSql\Model\Statement\Shape\Field::column() packages/sql-semantics-postgres/src/Model/Statement/Shape/Field.php:69
Constant reads 2
- class-const SqlSemantics\Platform\PostgreSql\Model\Statement\Shape\RowShape::__construct() packages/sql-semantics-postgres/src/Model/Statement/Shape/RowShape.php:44
- class-const SqlSemantics\Platform\PostgreSql\Statement\Expression\Constructor\Composite::__construct() packages/sql-semantics-postgres/src/Statement/Expression/Constructor/Composite.php:41
Type declarations 10
- type SqlSemantics\Platform\PostgreSql\Model\Resolution\ImplicitSlot packages/sql-semantics-postgres/src/Model/Resolution/ImplicitSlot.php:21
- type SqlSemantics\Platform\PostgreSql\Model\Statement\Reference\Column\ResolvedColumn packages/sql-semantics-postgres/src/Model/Statement/Reference/Column/ResolvedColumn.php:35
- type SqlSemantics\Platform\PostgreSql\Model\Statement\Shape\Field packages/sql-semantics-postgres/src/Model/Statement/Shape/Field.php:55
- type SqlSemantics\Platform\PostgreSql\Rules\Manipulation\AssignmentCasts packages/sql-semantics-postgres/src/Rules/Manipulation/AssignmentCasts.php:76
- type SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:90
- type SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:116
- type SqlSemantics\Platform\PostgreSql\Rules\Manipulation\Assignments packages/sql-semantics-postgres/src/Rules/Manipulation/Assignments.php:240
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:166
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\Joining packages/sql-semantics-postgres/src/Rules/Resolution/Joining.php:181
- type SqlSemantics\Platform\PostgreSql\Rules\Resolution\TableFunctionShapes packages/sql-semantics-postgres/src/Rules/Resolution/TableFunctionShapes.php:165