final class CreateAssertion
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

CREATE ASSERTION: a condition over the database, which the grammar reads and the server does not implement.

The grammar keeps the SQL-standard statement; the server rejects it with "CREATE ASSERTION is not yet

  • implemented", which is reported. The condition is derived where no relation is visible.

Source: https://www.postgresql.org/docs/17/unsupported-features-sql-standard.html.

Reading an assertiondoctest
(new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE ASSERTION a CHECK (1 = 1)') // throws \SqlSemantics\Platform\PostgreSql\Model\Diagnostic\SemanticException: CREATE ASSERTION is not yet implemented

Properties§

public list<ConstraintAttribute> $attributes
public DottedName $name
public Scalar $condition

Methods§

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

Parameters

$nameDottedNameThe assertion name
$conditionScalarThe condition
$attributeslist<ConstraintAttribute>The attributes in the order written
Calls 2
public function deriveStatement(Derivation $derivation): void

Reports that the server does not implement the statement and derives the condition.

Parameters

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

Writes the statement.

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 1