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.

Dropping a constraint if it existsdoctest
$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 $name
public Name $constraint
public bool $ifExists = false
public DropBehavior|null $behavior = null

Methods§

public function __construct(
    public DottedName $name,
    public Name $constraint,
    public bool $ifExists = false,
    public DropBehavior|null $behavior = null,
)

Parameters

$nameDottedNameThe domain name
$constraintNameThe constraint name
$ifExistsboolWhether IF EXISTS is written
$behaviorDropBehavior|nullThe drop behavior, when written
public function deriveStatement(Derivation $derivation): void

Derives nothing: domains are not part of a declaration context.

Parameters

$derivationDerivation
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 3

Test cases 1§

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

Dedicated tests 1

Relations§

Instantiated in 2