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.

Deferring every constraintdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('SET CONSTRAINTS ALL DEFERRED');
    [$operation->statement->constraints, $operation->statement->deferred] // => [[], true]

Properties§

public list<QualifiedName> $constraints
public bool $deferred

Methods§

public function __construct(list<QualifiedName> $constraints, public bool $deferred)

Parameters

$constraintslist<QualifiedName>The constraint names; none stands for ALL
$deferredboolTrue for DEFERRED, false for IMMEDIATE
Calls 2
public function deriveStatement(Derivation $derivation): void

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

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 5

Test cases 3§

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

Dedicated tests 1
Other tests reaching this symbol 2

Relations§

Instantiated in 1