final class NullTest
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A test for NULL: a IS [NOT] NULL, a ISNULL, a NOTNULL.

Mirrors PostgreSQL's NullTest node (IS_NULL, IS_NOT_NULL). For a row value the test applies to every field.

Rule: PG-NULL-TEST-001. Facts: boolean, never NULL. The operand must keep its place before IS (PG-PRECEDENCE-001). Source: https://www.postgresql.org/docs/17/functions-comparison.html. Status: Implemented.

A NULL test is never NULLdoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SELECT NULL IS NOT NULL')->field(0)->nullability // => \SqlSemantics\Platform\PostgreSql\Model\Statement\Type\Nullability::NotNull

Properties§

public Scalar $operand
public bool $negated
public NullTestSpelling $spelling = NullTestSpelling::Keywords

Methods§

public function __construct(
    public Scalar $operand,
    public bool $negated,
    public NullTestSpelling $spelling = NullTestSpelling::Keywords,
)

Parameters

$operandScalarThe tested value
$negatedboolWhether the test is for a value that is not NULL
$spellingNullTestSpellingHow the test is written
Calls 5
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the operand; the test is a boolean that is never NULL.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 5
public function render(Output $out): void

Writes the value and the test.

Parameters

$outOutput
Test cases 1
Calls 4

Test cases 12§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 4
Other tests reaching this symbol 8

Relations§

Instantiated in 1
Type checks 1