classTableConstraint
final class TableConstraint
Public API: explicitly declared with
@visibility public.A declared integrity condition, retaining its complete syntax for downstream consumers.
$consume = static fn (\SqlSemantics\Core\Schema\TableConstraint $value): string => $value::class;
$consume instanceof \Closure // => trueProperties§
public ConstraintKind $kindpublic list<string> $columnspublic Element $sourcepublic string|null $name = nullpublic list<string> $referencedTable = []public list<string> $referencedColumns = []public Element|null $expression = nullpublic bool $inline = falsepublic bool $descending = falseMethods§
public function __construct(
public ConstraintKind $kind,
public list<string> $columns,
public Element $source,
public string|null $name = null,
public list<string> $referencedTable = [],
public list<string> $referencedColumns = [],
public Element|null $expression = null,
public bool $inline = false,
public bool $descending = false,
)Parameters
$kind | ConstraintKind | Integrity condition |
$columns | list<string> | Local columns, in declaration order |
$source | Element | Typed constraint declaration, including actions and deferrability |
$name | string|null | Explicit constraint name |
$referencedTable | list<string> | Qualified foreign table name |
$referencedColumns | list<string> | Referenced key columns; empty means the primary key |
$expression | Element|null | Typed CHECK expression |
$inline | bool | |
$descending | bool |
Throws
InvalidArgumentException When supplied state violates its invariantsCalls 5
- static-call Invariant::names() line 42
- static-call Invariant::elements() line 45
- static-call Invariant::ensure() line 46
- class-const ConstraintKind::Check() line 46
- class-const ConstraintKind::ForeignKey() line 47
Test cases 60§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
TableConstraintTestcalls
Other tests reaching this symbol 59
SchemaAnalyzerTestcallsColumnPropertiesTestcallsColumnReaderTestcallsConstraintReaderTestcallsIdentifiersTestcallsSchemaChangesTestcallsSchemaReaderTestcallsStatementListTestcallsTokenGroupsTestcallsTreeTestcallsTypeReaderTestcallsBinderTestcallsBoundRelationTestcallsExpressionBinderTestcallsExpressionRulesTestcallsFromBinderTestcallsIdentitySequenceTestcallsLiteralBinderTestcallsNullFactsTestcallsProjectionBinderTestcallsScopeTestcallsSelectBinderTestcallsSelectModifiersBinderTestcallsSyntaxGuardTestcallsTableResolverTestcallsTypeResolutionTestcallsDialectTestcallsBoundSelectTestcallsColumnBindingTestcallsExpressionKindTestcallsExpressionTestcallsJoinKindTestcallsJoinTestcallsOrderingTestcallsOutputColumnTestcallsTableUseTestcallsPlatformTestcallsNameRulesTestcallsQueryRulesTestcallsSchemaRulesTestcallsSyntaxRulesTestcallsTypeRulesTestcallsColumnDefinitionTestcallsColumnGenerationTestcallsConstraintKindTestcallsGenerationKindTestcallsInvariantTestcallsTableDefinitionTestcallsSchemaBuilderTestcallsSchemaTestcallsSemanticExceptionTestcallsNullabilityTestcallsTypeDescriptorTestcallsSchemaTestcallsNameRulesTestcallsPlatformTestcallsQueryRulesTestcallsSchemaRulesTestcallsTypeRulesTestcalls