final class ConstraintName
    implements ColumnConstraint, TableConstraint
    uses Snapshot
Public API: explicitly declared with @visibility public.

A CONSTRAINT name clause.

Rule: SQLITE-CONSTRAINT-NAME-001. In the grammar the clause is an element of the constraint list of its own, not a part of the constraint after it: it may be repeated and it may be the last element. SQLite remembers the most recent name and uses it only to name the CHECK constraints that follow in the error they raise. The remembered name is forgotten at the start of the next column definition and at a comma between table constraints, so the model keeps the clause at its written place. Source: https://sqlite.org/syntax/column-constraint.html, https://sqlite.org/syntax/table-constraint.html. Status: Implemented.

Reading a constraint name that precedes a CHECKdoctest
$create = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('CREATE TABLE t (a CONSTRAINT positive CHECK (a > 0))');
    $create->statement->columns[0]->constraints[0]->name->value // => 'positive'

Properties§

public Name $name

Methods§

public function __construct(public Name $name)

Parameters

$nameNameThe constraint name
public function deriveConstraint(Derivation $derivation, ConstraintScope $scope): void

Derives nothing: the clause has no operand that depends on a declaration.

Parameters

$derivationDerivation
$scopeConstraintScope
public function render(Output $out): void

Writes the clause.

Parameters

$outOutput
Calls 2

Test cases 6§

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

Dedicated tests 2
Other tests reaching this symbol 4

Relations§

Instantiated in 2