classAlterDomainConstraint
final class AlterDomainConstraint
implements Statement, Relation
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to add a constraint to a domain: ALTER DOMAIN name ADD constraint [ NOT VALID ].
Rule: PG-DOMAIN-002. Mirrors AlterDomainStmt subtype 'C'. Release 16 writes a table constraint, release 17 a domain constraint (DomainCheck, DomainNotNull). The constraint sees VALUE, whose type depends on the undeclared domain (PG-DOMAIN-VALUE-001); kinds a domain cannot have are diagnostics (PG-DOMAIN-CHECK-001). Source: https://www.postgresql.org/docs/17/sql-alterdomain.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DOMAIN posint ADD CONSTRAINT positive CHECK (VALUE > 0) NOT VALID');
$operation->toString() // => 'ALTER DOMAIN posint ADD CONSTRAINT positive CHECK (value > 0) NOT VALID'Properties§
public DottedName $namepublic Clause $constraintMethods§
public function __construct(public DottedName $name, public Clause $constraint)Parameters
$name | DottedName | The domain name |
$constraint | Clause | The constraint |
public function deriveStatement(Derivation $derivation): voidDerives the constraint, which sees the value as VALUE.
Parameters
$derivation | Derivation |
Calls 6
- method-call DomainChecks::constraints() line 52
- new DomainChecks line 52
- new DomainInput line 53
- method-call Clause::deriveClause() line 54
- method-call DomainInput::environment() line 54
- method-call DomainInput::undeclared() line 54
public function deriveRelation(Derivation $derivation, Environment $environment): RelationFactAnswers the row the constraint sees besides VALUE: none.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 2
- new RelationFact line 62
- new RowShape line 62
public function render(Output $out): voidTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.