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

An EXCLUDE table constraint: no two rows satisfy all the operators of the elements together.

Mirrors CONSTR_EXCLUSION with access_method, exclusions, including, options, indexspace, where_clause and the attributes. The keys and the predicate are derived where the columns of the table are visible. Source: https://www.postgresql.org/docs/17/sql-createtable.html#SQL-CREATETABLE-EXCLUDE.

Reading an exclusion constraintdoctest
$create = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('CREATE TABLE t (c circle, EXCLUDE USING gist (c WITH OPERATOR(pg_catalog.&&)) WHERE (c IS NOT NULL))');
    $create->toString() // => 'CREATE TABLE t (c circle, EXCLUDE USING gist (c WITH OPERATOR (pg_catalog.&&)) WHERE (c IS NOT NULL))'

Properties§

public non-empty-list<ExclusionElement> $elements
public list<Name> $included
public list<Definition> $options
public list<ConstraintAttribute> $attributes
public Name|null $method = null
public Name|null $tablespace = null
public Scalar|null $where = null
public Name|null $name = null

Methods§

public function __construct(
    list<ExclusionElement> $elements,
    public Name|null $method = null,
    list<Name> $included = [],
    list<Definition> $options = [],
    public Name|null $tablespace = null,
    public Scalar|null $where = null,
    list<ConstraintAttribute> $attributes = [],
    public Name|null $name = null,
)

Parameters

$elementslist<ExclusionElement>The elements; at least one
$methodName|nullThe index access method
$includedlist<Name>The included columns
$optionslist<Definition>The storage parameters of the index
$tablespaceName|nullThe tablespace of the index
$whereScalar|nullThe predicate of a partial constraint
$attributeslist<ConstraintAttribute>The attributes in the order written
$nameName|nullThe constraint name
Calls 6
public function kind(): ConstraintKind

Answers the kind of the constraint.

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

Derives the elements and the predicate against the table.

Parameters

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

Writes the constraint.

Parameters

$outOutput
Calls 7

Test cases 2§

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 1

Relations§

Instantiated in 1
Constant reads 1