final class NotNull
    implements Constraint
    uses Snapshot
Public API: explicitly declared with @visibility public.

A NOT NULL column constraint: the column never holds NULL. Mirrors CONSTR_NOTNULL.

Source: https://www.postgresql.org/docs/17/sql-createtable.html.

Reading the constraintdoctest
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (a int CONSTRAINT nn NOT NULL)');
    $create->statement->definition->elements[0]->qualifiers[0]->name?->value // => 'nn'

Properties§

public Name|null $name = null

Methods§

public function __construct(public Name|null $name = null)

Parameters

$nameName|nullThe constraint name
public function kind(): ConstraintKind

Answers the kind of the constraint.

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

Derives nothing: the constraint has no operand.

Parameters

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

Writes the constraint.

Parameters

$outOutput
Calls 3

Test cases 4§

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 3

Relations§

Instantiated in 1
Constant reads 1
Type checks 2