final class TableConstraint
Public API: explicitly declared with @visibility public.

A declared integrity condition, retaining its complete syntax for downstream consumers.

Accept this semantic value in a database-independent consumerdoctest
$consume = static fn (\SqlSemantics\Core\Schema\TableConstraint $value): string => $value::class;
    $consume instanceof \Closure // => true

Properties§

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

Methods§

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

$kindConstraintKindIntegrity condition
$columnslist<string>Local columns, in declaration order
$sourceElementTyped constraint declaration, including actions and deferrability
$namestring|nullExplicit constraint name
$referencedTablelist<string>Qualified foreign table name
$referencedColumnslist<string>Referenced key columns; empty means the primary key
$expressionElement|nullTyped CHECK expression
$inlinebool
$descendingbool

Throws

InvalidArgumentException When supplied state violates its invariants
Calls 5

Test cases 60§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 59

Relations§

Instantiated in 1
Constant reads 1
Type declarations 1