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

An ordered table declaration with a schema-qualified identity and integrity constraints.

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

Properties§

public string $schema
public string $name
public list<ColumnDefinition> $columns
public list<TableConstraint> $constraints
public Element $source
public 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

$schemastringResolved schema or database name
$namestringResolved table name
$columnslist<ColumnDefinition>Columns in declaration order
$constraintslist<TableConstraint>Declared integrity conditions
$sourceElementTyped CREATE TABLE declaration
$optionslist<Element>Typed table options

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 10