classDropDomainConstraint
final class DropDomainConstraint
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.A request to remove a constraint of a domain.
Rule: PG-DOMAIN-005. Mirrors AlterDomainStmt subtype 'X' with missing_ok and the drop behavior. Source: https://www.postgresql.org/docs/17/sql-alterdomain.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER DOMAIN d DROP CONSTRAINT IF EXISTS c CASCADE');
[$operation->statement->ifExists, $operation->statement->behavior] // => [true, \SqlSemantics\Platform\PostgreSql\Statement\Option\DropBehavior::Cascade]Properties§
public DottedName $namepublic Name $constraintpublic bool $ifExists = falsepublic DropBehavior|null $behavior = nullMethods§
public function __construct(
public DottedName $name,
public Name $constraint,
public bool $ifExists = false,
public DropBehavior|null $behavior = null,
)Parameters
$name | DottedName | The domain name |
$constraint | Name | The constraint name |
$ifExists | bool | Whether IF EXISTS is written |
$behavior | DropBehavior|null | The drop behavior, when written |
public function deriveStatement(Derivation $derivation): voidDerives nothing: domains are not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 54
- method-call Output::name() line 58
- class-const NameUse::Column() line 58
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
DropDomainConstraintTestcalls