final class Attributes
Restricted visibility: declared "@visibility SqlSemantics\Platform\PostgreSql". Code outside that scope must not name this declaration.

Checks the attributes written after a table constraint.

Rule: PG-CONSTRAINT-ATTRIBUTES-001. The attributes are kept in the order written. The server rejects, as it reads ConstraintAttributeSpec, NOT DEFERRABLE together with INITIALLY DEFERRED ("constraint declared

  • INITIALLY DEFERRED must be DEFERRABLE"), and DEFERRABLE with NOT

DEFERRABLE or INITIALLY DEFERRED with INITIALLY IMMEDIATE ("conflicting

  • constraint properties"). Then each kind of constraint admits only some of

them (processCASbits): DEFERRABLE and INITIALLY DEFERRED only UNIQUE, PRIMARY KEY, EXCLUDE and FOREIGN KEY; NOT VALID only CHECK and FOREIGN KEY; NO INHERIT only CHECK. NOT DEFERRABLE and INITIALLY IMMEDIATE are the defaults and always admitted. Source: https://www.postgresql.org/docs/17/sql-createtable.html. Termination: one pass over the attributes. Status: Implemented.

Methods§

public function checked(array<array-key, object|scalar|null> $attributes): list<ConstraintAttribute>

Checks that a list holds attributes.

Parameters

$attributesarray<array-key, object|scalar|null>

Returns

Test cases 1
Called from 9
Calls 3
public function report(
    Derivation $derivation,
    list<ConstraintAttribute> $attributes,
    string $label,
    bool $deferrable,
    bool $notValid,
    bool $noInherit,
): void

Reports the conflicts and the attributes the kind of constraint does not admit.

Parameters

$derivationDerivation
$attributeslist<ConstraintAttribute>
$labelstringThe name of the kind of constraint in the server's messages
$deferrablebool
$notValidbool
$noInheritbool
Called from 8
Calls 15

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 17
Method calls 17