final class ConstraintRun
    implements Node
    uses Snapshot
Public API: explicitly declared with @visibility public.

The table constraints written one after another without a comma between them.

Rule: SQLITE-CONSTRAINT-RUN-001. The comma between table constraints is optional, but it is not without meaning: a CONSTRAINT name clause stays in effect for the constraints that follow it until the next comma. A table definition therefore holds its table constraints as comma-separated runs, and a constraint name belongs to its run. Source: https://sqlite.org/syntax/create-table-stmt.html (grammar tconscomma). Status: Implemented.

Telling a named constraint from a name the comma cuts offdoctest
$semantics = new \SqlSemantics\Platform\Sqlite\Semantics();
    $named = $semantics->analyze('CREATE TABLE t (a, CONSTRAINT c CHECK (a > 0))');
    $cut = $semantics->analyze('CREATE TABLE t (a, CONSTRAINT c, CHECK (a > 0))');
    [count($named->statement->constraints), count($cut->statement->constraints)] // => [1, 2]

Properties§

public non-empty-list<TableConstraint> $items

Methods§

public function __construct(list<TableConstraint> $items)

Parameters

$itemslist<TableConstraint>The constraints of the run in written order; at least one
Calls 2
public function render(Output $out): void

Writes the constraints without a comma between them.

Parameters

$outOutput
Calls 1

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 2
Constant reads 1