classSchemaReader
final class SchemaReader
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Builds a schema snapshot from CREATE TABLE syntax nodes.
Properties§
public Identifiers $identifierspublic string $defaultSchemaMethods§
public function __construct(
public Identifiers $identifiers,
public string $defaultSchema,
?ValueReader $values = null,
)Binds the dependencies used for semantic binding.
Parameters
$identifiers | Identifiers | |
$defaultSchema | string | |
$values | ?ValueReader |
Calls 2
- method-call DialectParser::version() line 29
- new DialectParser line 29
public function read(list<Node> $trees): list<TableDefinition>Parameters
$trees | list<Node> |
Returns
list<TableDefinition>Throws
Called from 1
Calls 10
- static-call StatementList::read() line 41
- static-call Tree::child() line 42
- method-call SchemaChanges::drop() line 43
- new SchemaChanges line 43
- static-call Tree::unsupported() line 47
- method-call SchemaReader::table() line 49
- function-call
preg_matchline 51 - static-call Tree::text() line 51
- new SemanticException line 55
- function-call
array_valuesline 61
public function table(Node $create): TableDefinitionReads one table and promotes the nullability of primary key columns.
Parameters
$create | Node |
Returns
Called from 1
Calls 16
- static-call Tree::outer() line 69
- static-call Tree::child() line 70
- static-call Tree::unsupported() line 72
- method-call Identifiers::parts() line 74
- function-call
countline 76 - method-call SchemaReader::validate() line 79
- method-call SchemaReader::columnNodes() line 82
- method-call ColumnReader::read() line 83
- new ColumnReader line 83
- function-call
array_pushline 85 - method-call ConstraintReader::read() line 88
- new ConstraintReader line 88
- method-call SchemaReader::primaryKeys() line 96
- new TableDefinition line 98
- method-call ValueReader::read() line 98
- function-call
array_mapline 98
Rejects declarations whose column state requires evaluating another relation.
Called from 1
public function primaryKeys(
list<ColumnDefinition> $columns,
list<TableConstraint> $constraints,
Node $source,
): list<ColumnDefinition>Parameters
$columns | list<ColumnDefinition> | |
$constraints | list<TableConstraint> | |
$source | Node |
Returns
list<ColumnDefinition>Throws
Called from 1
Calls 8
- function-call
array_mapline 125 - function-call
countline 126 - function-call
array_uniqueline 126 - new SemanticException line 127
- function-call
in_arrayline 132 - class-const ConstraintKind::PrimaryKey() line 136
- method-call SchemaReader::primaryNotNull() line 145
- class-const Nullability::NotNull() line 146
public function primaryNotNull(
ColumnDefinition $column,
list<string> $primary,
list<TableConstraint> $constraints,
): boolParameters
$column | ColumnDefinition | |
$primary | list<string> | |
$constraints | list<TableConstraint> |
Returns
boolPrivate surface 1§
Implementation details, listed for orientation only.
private ValueReader $valuesTest cases 60§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SchemaReaderTestcalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsIdentifiersTestcallsSchemaChangesTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTest::testColumnNodesHonorsAnInjectedPolicycallsSyntaxRulesTestcallsTypeRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcallsTypeRulesTestcalls