classAlterConstraint
final class AlterConstraint
implements AlterCommand
uses Snapshot
Public API: explicitly declared with
@visibility public.ALTER CONSTRAINT: changes the deferral attributes of a constraint.
Mirrors AT_AlterConstraint. The server accepts this only for foreign keys; the conflicts of the attributes are checked by PG-CONSTRAINT-ATTRIBUTES-001. Source: https://www.postgresql.org/docs/17/sql-altertable.html.
$statement = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('ALTER TABLE t ALTER CONSTRAINT fk DEFERRABLE INITIALLY DEFERRED');
$statement->toString() // => 'ALTER TABLE t ALTER CONSTRAINT fk DEFERRABLE INITIALLY DEFERRED'Properties§
public list<ConstraintAttribute> $attributespublic Name $nameMethods§
public function __construct(public Name $name, list<ConstraintAttribute> $attributes)Parameters
$name | Name | The constraint |
$attributes | list<ConstraintAttribute> | The attributes in the order written |
Calls 2
- method-call Attributes::checked() line 43
- new Attributes line 43
public function deriveClause(Derivation $derivation, Environment $environment): voidChecks the attributes.
Parameters
$derivation | Derivation | |
$environment | Environment |
Calls 2
- method-call Attributes::report() line 51
- new Attributes line 51
public function render(Output $out): voidWrites the action.
Parameters
$out | Output |
Calls 3
- method-call Output::keyword() line 59
- method-call Writing::sequence() line 60
- new Writing line 60
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
AlterConstraintTestcalls