enum ConstraintAttribute: string
    implements Clause
Public API: explicitly declared with @visibility public.

A property written after a constraint: whether it can be deferred, when it is checked, and whether it is validated or inherited.

Mirrors the CONSTR_ATTR_* values of PostgreSQL's Constraint node and the CAS_* bits of ConstraintAttributeSpec. NOT DEFERRABLE and INITIALLY IMMEDIATE are the defaults; a written default is kept as written. Source: https://www.postgresql.org/docs/17/sql-createtable.html.

Reading the attributes of a table constraintdoctest
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a int, UNIQUE (a) DEFERRABLE INITIALLY DEFERRED)');
    $create->statement->definition->elements[1]->attributes // => [\SqlSemantics\Platform\PostgreSql\Statement\Constraint\ConstraintAttribute::Deferrable, \SqlSemantics\Platform\PostgreSql\Statement\Constraint\ConstraintAttribute::InitiallyDeferred]

Cases§

case Deferrable = 'DEFERRABLE'
case NotDeferrable = 'NOT DEFERRABLE'
case InitiallyDeferred = 'INITIALLY DEFERRED'
case InitiallyImmediate = 'INITIALLY IMMEDIATE'
case NotValid = 'NOT VALID'
case NoInherit = 'NO INHERIT'

Methods§

public function deferral(): bool

Tells whether the attribute can be written after a column constraint, where only the deferral attributes are allowed.

Returns

bool
Calls 6
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives nothing: an attribute has no operand.

Parameters

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

Writes the keywords.

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 1
Other tests reaching this symbol 5

Relations§

Constant reads 32
Type checks 4
Type declarations 2