final class DomainCheck
    implements Clause
    uses Snapshot
Public API: explicitly declared with @visibility public.

A CHECK constraint added to a domain in release 17: [ CONSTRAINT name ] CHECK ( expression ) attributes.

Mirrors the Constraint of kind CONSTR_CHECK that DomainConstraintElem builds. NOT VALID skips checking existing values; deferral and NO INHERIT are diagnostics (PG-DOMAIN-CHECK-001). Source: https://www.postgresql.org/docs/17/sql-alterdomain.html.

Reading the attributes of an added checkdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DOMAIN d ADD CHECK (VALUE <> 0) NOT VALID');
    $operation->statement->constraint->attributes // => [\SqlSemantics\Platform\PostgreSql\Statement\Constraint\ConstraintAttribute::NotValid]

Properties§

public list<ConstraintAttribute> $attributes
public Name|null $name
public Scalar $condition

Methods§

public function __construct(
    public Name|null $name,
    public Scalar $condition,
    list<ConstraintAttribute> $attributes = [],
)

Parameters

$nameName|nullThe constraint name, when CONSTRAINT is written
$conditionScalarThe condition
$attributeslist<ConstraintAttribute>The attributes in the order written
Calls 2
public function deriveClause(Derivation $derivation, Environment $environment): void

Derives the condition where VALUE is visible and checks the attributes.

Parameters

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

Writes the constraint.

Parameters

$outOutput
Calls 3

Test cases 2§

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 1

Relations§

Instantiated in 1
Type declarations 2