classExclusionElement
final class ExclusionElement
implements Clause
uses Snapshot
Public API: explicitly declared with
@visibility public.One element of an exclusion constraint: a key and the operator no two rows may satisfy together.
Mirrors one pair of the exclusions list of CONSTR_EXCLUSION. The operator is written as an operator or as OPERATOR(...), which the operator name keeps. 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 &&))');
$create->statement->definition->elements[1]->elements[0]->operator->name->value // => '&&'Properties§
public IndexElement $elementpublic OperatorName $operatorMethods§
public function __construct(public IndexElement $element, public OperatorName $operator)Parameters
$element | IndexElement | The key |
$operator | OperatorName | The operator |
public function deriveClause(Derivation $derivation, Environment $environment): voidDerives the key.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 1
- method-call IndexElement::deriveClause() line 45
public function render(Output $out): voidWrites the key, WITH and the operator.
Parameters
$out | Output |
Calls 1
- method-call Output::node() line 53
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
ExclusionElementTestcalls
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:177
- new SqlSemantics\Platform\PostgreSql\Lowering\Table\ConstraintRule::exclusions() packages/sql-semantics-postgres/src/Lowering/Table/ConstraintRule.php:178