classTableDefinition
final class TableDefinition
Public API: explicitly declared with
@visibility public.An ordered table declaration with a schema-qualified identity and integrity constraints.
$consume = static fn (\SqlSemantics\Core\Schema\TableDefinition $value): string => $value::class;
$consume instanceof \Closure // => trueProperties§
public string $schemapublic string $namepublic list<ColumnDefinition> $columnspublic list<TableConstraint> $constraintspublic Element $sourcepublic list<Element> $options = []Methods§
public function __construct(
public string $schema,
public string $name,
public list<ColumnDefinition> $columns,
public list<TableConstraint> $constraints,
public Element $source,
public list<Element> $options = [],
)Parameters
$schema | string | Resolved schema or database name |
$name | string | Resolved table name |
$columns | list<ColumnDefinition> | Columns in declaration order |
$constraints | list<TableConstraint> | Declared integrity conditions |
$source | Element | Typed CREATE TABLE declaration |
$options | list<Element> | Typed table options |
Throws
InvalidArgumentException When supplied state violates its invariantsCalls 5
- static-call Invariant::members() line 38
- class-const ColumnDefinition::class() line 38
- class-const TableConstraint::class() line 39
- class-const Element::class() line 40
- static-call Invariant::elements() line 41
Test cases 60§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TableDefinitionTestcalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsTypeRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableConstraintTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcallsTypeRulesTestcalls
Relations§
Instantiated in 1
Constant reads 1
Type declarations 10
- type SqlSemantics\Platform\MySql\SchemaRules packages/sql-semantics-mysql/src/SchemaRules.php:82
- type SqlSemantics\Platform\PostgreSql\SchemaRules packages/sql-semantics-postgres/src/SchemaRules.php:82
- type SqlSemantics\Platform\Sqlite\SchemaRules packages/sql-semantics-sqlite/src/SchemaRules.php:103
- type SqlSemantics\Core\Ast\SchemaReader packages/sql-semantics/src/Core/Ast/SchemaReader.php:67
- type SqlSemantics\Core\Binding\TableResolver packages/sql-semantics/src/Core/Binding/TableResolver.php:31
- type SqlSemantics\Core\Model\ColumnBinding packages/sql-semantics/src/Core/Model/ColumnBinding.php:28
- type SqlSemantics\Core\Model\TableUse packages/sql-semantics/src/Core/Model/TableUse.php:31
- type SqlSemantics\Core\Policy\SchemaRules packages/sql-semantics/src/Core/Policy/SchemaRules.php:54
- type SqlSemantics\Core\Schema packages/sql-semantics/src/Core/Schema.php:48
- type SqlSemantics\Core\Schema\Invariant packages/sql-semantics/src/Core/Schema/Invariant.php:72