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

A NOT NULL constraint added to a domain in release 17: [ CONSTRAINT name ] NOT NULL attributes.

Mirrors the Constraint of kind CONSTR_NOTNULL that DomainConstraintElem builds. Deferral and NOT VALID are diagnostics (PG-DOMAIN-CHECK-001). Source: https://www.postgresql.org/docs/17/sql-alterdomain.html.

Adding a named not-null constraintdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DOMAIN d ADD CONSTRAINT nn NOT NULL');
    $operation->statement->constraint->name?->value // => 'nn'

Properties§

public list<ConstraintAttribute> $attributes
public Name|null $name = null

Methods§

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

Parameters

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

Checks the attributes.

Parameters

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

Writes the constraint.

Parameters

$outOutput
Calls 3

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 1
Type declarations 2