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

A NULL column constraint: the column may hold NULL, which is the default. Mirrors CONSTR_NULL; it conflicts with NOT NULL on the same column.

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 NULL)');
    $create->statement->definition->elements[0]->qualifiers[0]->name?->value // => null

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 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
Constant reads 1
Type checks 3