classSchema
final class Schema
Public API: explicitly declared with
@visibility public.A closed schema snapshot. Missing declarations are errors, not invented tables.
$consume = static fn (\SqlSemantics\Core\Schema $value): string => $value::class;
$consume instanceof \Closure // => trueProperties§
public Dialect $dialectpublic list<TableDefinition> $tablespublic string $defaultSchemapublic string $grammarVersionMethods§
public function __construct(
public Dialect $dialect,
public list<TableDefinition> $tables,
public string $defaultSchema,
public string $grammarVersion,
)Parameters
$dialect | Dialect | Language used to interpret the declarations |
$tables | list<TableDefinition> | Declarations visible to semantic binding |
$defaultSchema | string | Schema used for unqualified table declarations and references |
$grammarVersion | string | Resolved sql-parser grammar release shared by DDL and SELECT |
Throws
InvalidArgumentException When supplied state violates its invariantsCalls 5
- static-call Invariant::members() line 34
- class-const TableDefinition::class() line 34
- static-call Invariant::ensure() line 35
- method-call Dialect::platform() line 38
- static-call Invariant::table() line 41
public function withTables(TableDefinition ...$tables): selfReplaces state tables while preserving this snapshot and its language context.
Parameters
$tables | TableDefinition |
Returns
selfThrows
InvalidArgumentException When the replacement state violates its invariantsTest cases 60§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
SchemaTestcallsSchemaTestcalls
Other tests reaching this symbol 58
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsTypeRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcallsTypeRulesTestcalls
Relations§
Instantiated in 1
Type declarations 6
- type SqlSemantics\Core\Analysis\SchemaAnalyzer packages/sql-semantics/src/Core/Analysis/SchemaAnalyzer.php:38
- type SqlSemantics\Core\Analysis\SchemaAnalyzer packages/sql-semantics/src/Core/Analysis/SchemaAnalyzer.php:52
- type SqlSemantics\Core\Binder packages/sql-semantics/src/Core/Binder.php:29
- type SqlSemantics\Core\Binding\TableResolver packages/sql-semantics/src/Core/Binding/TableResolver.php:23
- type SqlSemantics\Core\SchemaBuilder packages/sql-semantics/src/Core/SchemaBuilder.php:48
- type SqlSemantics\Facade\Schema packages/sql-semantics/src/Facade/Schema.php:39