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\MySql\Semantics();
$table = $semantics->analyze('CREATE TABLE t (a INTEGER NOT NULL)');
$semantics->analyze('SELECT a FROM t', [$table])->field('a')->slot->nullability // => \SqlSemantics\Platform\MySql\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\MySql\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-mysql/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\MySql\Model\Statement\Shape\Field::column() packages/sql-semantics-mysql/src/Model/Statement/Shape/Field.php:69
Test cases 24§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Other tests reaching this symbol 24
SubqueryRowsTest::testTestCombinesTheColumnsAndReportsAWidthMismatchcallsSubqueryRowsTest::testValueIsTheOneColumnOrARowcallsCommonTablesTest::testAnchoredBindsTheColumnsOfTheNonrecursivePartcallsCommonTablesTest::testNullableMakesEveryColumnNullablecallsCommonTablesTest::testShapeRenamesTheColumnsByTheColumnListcallsDerivedShapesTest::testShapeTakesTheSlotsOfTheQuerycallsDerivedShapesTest::testUniqueReportsADuplicateNamecallsJoinedInputTest::testCompleteTreatsANameThatDependsOnInputsAsUndecidedcallsJoinedInputTest::testOfAnswersTheShapeTheStarSelectscallsJoinedInputTest::testSlotAnswersTheSlotOfAnEntrycallsJoiningTest::testExtendMakesEveryColumnNullablecallsJoiningTest::testNullableKeepsANullableSlotcallsJoiningTest::testNullableKeepsTheInputsAnUnnamedSlotDependsOncallsProjectionTest::testFieldReferencesTheSlotOfTheRelationcallsResultSlotsTest::testCombineNamesAfterTheLeftOperandcallsColumnChangesTest::testApplyAnswersTheShapeAfterTheChangecallsColumnChangesTest::testImplicitAnswersTheInvisibleColumnscallsColumnChangesTest::testInsertPlacesFirstcallsColumnChangesTest::testShowMakesAColumnVisiblecallsAlterTableTest::testDeriveRelationAnswersTheColumnsAfterTheChangecallsPathColumnTest::testDeriveColumnsAnswersTheDeclaredTypecallsParameterListTest::testDeriveRelationAnswersOneNullablePositionPerParametercallsParameterListTest::testDeriveRelationAnswersTheRowOfAnAnalyzedRoutinecallsVariableDeclarationTest::testDeriveRelationAnswersANullablePositionPerNamecalls
Relations§
Instantiated in 35
- new SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::target() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:178
- new SqlSemantics\Platform\MySql\Rules\Dml\InsertFacts::open() packages/sql-semantics-mysql/src/Rules/Dml/InsertFacts.php:135
- new SqlSemantics\Platform\MySql\Rules\Dml\InsertFacts::open() packages/sql-semantics-mysql/src/Rules/Dml/InsertFacts.php:150
- new SqlSemantics\Platform\MySql\Rules\Dml\InsertFacts::column() packages/sql-semantics-mysql/src/Rules/Dml/InsertFacts.php:168
- new SqlSemantics\Platform\MySql\Rules\Dml\InsertFacts::column() packages/sql-semantics-mysql/src/Rules/Dml/InsertFacts.php:172
- new SqlSemantics\Platform\MySql\Rules\Dml\WriteScope::field() packages/sql-semantics-mysql/src/Rules/Dml/WriteScope.php:45
- new SqlSemantics\Platform\MySql\Rules\Query\CommonTables::shape() packages/sql-semantics-mysql/src/Rules/Query/CommonTables.php:128
- new SqlSemantics\Platform\MySql\Rules\Query\CommonTables::nullable() packages/sql-semantics-mysql/src/Rules/Query/CommonTables.php:141
- new SqlSemantics\Platform\MySql\Rules\Query\DerivedShapes::shape() packages/sql-semantics-mysql/src/Rules/Query/DerivedShapes.php:50
- new SqlSemantics\Platform\MySql\Rules\Query\DerivedShapes::shape() packages/sql-semantics-mysql/src/Rules/Query/DerivedShapes.php:65
- new SqlSemantics\Platform\MySql\Rules\Query\DerivedShapes::shape() packages/sql-semantics-mysql/src/Rules/Query/DerivedShapes.php:67
- new SqlSemantics\Platform\MySql\Rules\Query\DerivedShapes::shape() packages/sql-semantics-mysql/src/Rules/Query/DerivedShapes.php:69
- new SqlSemantics\Platform\MySql\Rules\Query\From\Joining::nullable() packages/sql-semantics-mysql/src/Rules/Query/From/Joining.php:162
- new SqlSemantics\Platform\MySql\Rules\Query\Projection::items() packages/sql-semantics-mysql/src/Rules/Query/Projection.php:60
- new SqlSemantics\Platform\MySql\Rules\Query\Projection::field() packages/sql-semantics-mysql/src/Rules/Query/Projection.php:149
- new SqlSemantics\Platform\MySql\Rules\Query\ResultSlots::combine() packages/sql-semantics-mysql/src/Rules/Query/ResultSlots.php:73
- new SqlSemantics\Platform\MySql\Rules\Query\ResultSlots::values() packages/sql-semantics-mysql/src/Rules/Query/ResultSlots.php:119
- new SqlSemantics\Platform\MySql\Rules\Query\TableShapes::named() packages/sql-semantics-mysql/src/Rules/Query/TableShapes.php:58
- new SqlSemantics\Platform\MySql\Rules\Query\TableShapes::implicit() packages/sql-semantics-mysql/src/Rules/Query/TableShapes.php:84
- new SqlSemantics\Platform\MySql\Rules\Query\TableShapes::explicit() packages/sql-semantics-mysql/src/Rules/Query/TableShapes.php:97
- new SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges::apply() packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:101
- new SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges::rename() packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:211
- new SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges::slot() packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:325
- new SqlSemantics\Platform\MySql\Rules\TableChange\Targets::target() packages/sql-semantics-mysql/src/Rules/TableChange/Targets.php:54
- new SqlSemantics\Platform\MySql\Rules\TableDefinition\TableTargets::shape() packages/sql-semantics-mysql/src/Rules/TableDefinition/TableTargets.php:55
- new SqlSemantics\Platform\MySql\Rules\TableDefinition\TableTargets::implicit() packages/sql-semantics-mysql/src/Rules/TableDefinition/TableTargets.php:70
- new SqlSemantics\Platform\MySql\Rules\Utility\ShowRows::slots() packages/sql-semantics-mysql/src/Rules/Utility/ShowRows.php:99
- new SqlSemantics\Platform\MySql\Rules\Utility\ShowTargets::derive() packages/sql-semantics-mysql/src/Rules/Utility/ShowTargets.php:50
- new SqlSemantics\Platform\MySql\Statement\Call\Json\NestedColumns::deriveColumns() packages/sql-semantics-mysql/src/Statement/Call/Json/NestedColumns.php:61
- new SqlSemantics\Platform\MySql\Statement\Call\Json\OrdinalityColumn::deriveColumns() packages/sql-semantics-mysql/src/Statement/Call/Json/OrdinalityColumn.php:51
- new SqlSemantics\Platform\MySql\Statement\Call\Json\PathColumn::deriveColumns() packages/sql-semantics-mysql/src/Statement/Call/Json/PathColumn.php:82
- new SqlSemantics\Platform\MySql\Statement\Dml\Insert\RowAlias::deriveRelation() packages/sql-semantics-mysql/src/Statement/Dml/Insert/RowAlias.php:74
- new SqlSemantics\Platform\MySql\Statement\Dml\Insert\RowAlias::deriveRelation() packages/sql-semantics-mysql/src/Statement/Dml/Insert/RowAlias.php:92
- new SqlSemantics\Platform\MySql\Statement\Routine\ParameterList::deriveRelation() packages/sql-semantics-mysql/src/Statement/Routine/ParameterList.php:60
- new SqlSemantics\Platform\MySql\Statement\Routine\Program\VariableDeclaration::deriveRelation() packages/sql-semantics-mysql/src/Statement/Routine/Program/VariableDeclaration.php:73
Method calls 2
- method-call SqlSemantics\Platform\MySql\Model\Statement\Reference\Column\ResolvedColumn::declaration() packages/sql-semantics-mysql/src/Model/Statement/Reference/Column/ResolvedColumn.php:46
- method-call SqlSemantics\Platform\MySql\Model\Statement\Shape\Field::column() packages/sql-semantics-mysql/src/Model/Statement/Shape/Field.php:69
Constant reads 1
Type declarations 8
- type SqlSemantics\Platform\MySql\Model\Resolution\ImplicitSlot packages/sql-semantics-mysql/src/Model/Resolution/ImplicitSlot.php:21
- type SqlSemantics\Platform\MySql\Model\Statement\Reference\Column\ResolvedColumn packages/sql-semantics-mysql/src/Model/Statement/Reference/Column/ResolvedColumn.php:35
- type SqlSemantics\Platform\MySql\Model\Statement\Shape\Field packages/sql-semantics-mysql/src/Model/Statement/Shape/Field.php:55
- type SqlSemantics\Platform\MySql\Rules\Query\From\JoinedInput packages/sql-semantics-mysql/src/Rules/Query/From/JoinedInput.php:57
- type SqlSemantics\Platform\MySql\Rules\Query\From\Joining packages/sql-semantics-mysql/src/Rules/Query/From/Joining.php:160
- type SqlSemantics\Platform\MySql\Rules\Query\Projection packages/sql-semantics-mysql/src/Rules/Query/Projection.php:147
- type SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:277
- type SqlSemantics\Platform\MySql\Rules\TableChange\ColumnChanges packages/sql-semantics-mysql/src/Rules/TableChange/ColumnChanges.php:321