classSetConstraints
final class SetConstraints
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.SET CONSTRAINTS { ALL | name [, ...] } { DEFERRED | IMMEDIATE }: when the constraints are checked in the current transaction.
Rule: PG-SET-CONSTRAINTS-001. Mirrors PostgreSQL's ConstraintsSetStmt: the constraint names, where no name stands for ALL, and whether checking is deferred to the end of the transaction. Facts: none; a constraint is looked up by name among the constraints of the database when the command runs. Source: https://www.postgresql.org/docs/17/sql-set-constraints.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SET CONSTRAINTS ALL DEFERRED');
[$operation->statement->constraints, $operation->statement->deferred] // => [[], true]Properties§
public list<QualifiedName> $constraintspublic bool $deferredMethods§
public function __construct(list<QualifiedName> $constraints, public bool $deferred)Parameters
$constraints | list<QualifiedName> | The constraint names; none stands for ALL |
$deferred | bool | True for DEFERRED, false for IMMEDIATE |
Calls 2
- static-call Check::listOf() line 45
- class-const QualifiedName::class() line 45
public function deriveStatement(Derivation $derivation): voidDerives nothing: constraints are not part of a declaration context.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 5
- method-call Output::keyword() line 60
- method-call Output::symbol() line 66
- method-call Spelling::qualified() line 68
- new Spelling line 68
- class-const NameUse::Column() line 68
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SetConstraintsTestcalls