classExclusion
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.
$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> $elementspublic list<Name> $includedpublic list<Definition> $optionspublic list<ConstraintAttribute> $attributespublic Name|null $method = nullpublic Name|null $tablespace = nullpublic Scalar|null $where = nullpublic Name|null $name = nullMethods§
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
$elements | list<ExclusionElement> | The elements; at least one |
$method | Name|null | The index access method |
$included | list<Name> | The included columns |
$options | list<Definition> | The storage parameters of the index |
$tablespace | Name|null | The tablespace of the index |
$where | Scalar|null | The predicate of a partial constraint |
$attributes | list<ConstraintAttribute> | The attributes in the order written |
$name | Name|null | The constraint name |
Calls 6
- static-call Check::listOf() line 81
- class-const ExclusionElement::class() line 81
- class-const Name::class() line 82
- class-const Definition::class() line 83
- method-call Attributes::checked() line 84
- new Attributes line 84
public function kind(): ConstraintKindpublic function deriveClause(Derivation $derivation, Environment $environment): voidDerives the elements and the predicate against the table.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 6
- method-call KeyClauses::derive() line 103
- new KeyClauses line 103
- method-call Conditions::derive() line 105
- new Conditions line 105
- method-call Attributes::report() line 107
- new Attributes line 107
public function render(Output $out): voidWrites the constraint.
Parameters
$out | Output |
Calls 7
- new Writing line 115
- method-call Writing::constraintName() line 116
- method-call Output::keyword() line 117
- method-call Output::symbol() line 121
- method-call KeyClauses::write() line 122
- new KeyClauses line 122
- method-call Writing::sequence() line 126
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.