final class ConstraintRule
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.

Lowers table constraints, constraint attributes and foreign-key clauses.

Rule: PG-CONSTRAINT-LOWER-001. Scope: TableConstraint, ConstraintElem, opt_c_include, ExclusionConstraintList, ExclusionConstraintElem, OptConsTableSpace, ExistingIndex, ConstraintAttributeSpec, ConstraintAttributeElem, key_match, key_actions, key_update, key_delete, key_action. A constraint name is kept on its constraint; attributes and referential actions keep the order written. Termination: lists are flattened iteratively. Source: https://www.postgresql.org/docs/17/sql-createtable.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe hub
public function tableConstraint(Node $constraint): Constraint
public function attributes(Node $list): list<ConstraintAttribute>

Lowers ConstraintAttributeSpec.

Parameters

$listNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 8
Calls 3

Private surface 4§

Implementation details, listed for orientation only.

private const ATTRIBUTES = ['ConstraintAttributeElem: NOT DEFERRABLE' => \SqlSemantics\Platform\PostgreSql…
private const MATCH = ['key_match: MATCH FULL' => \SqlSemantics\Platform\PostgreSql\Statement\Constra…
private const ACTIONS = ['key_action: NO ACTION' => \SqlSemantics\Platform\PostgreSql\Statement\Constra…
private Lowering $lowering

Test cases 10§

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

Dedicated tests 10

Relations§

Instantiated in 3
Method calls 6