final class SavepointCommand
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

SAVEPOINT name, RELEASE [SAVEPOINT] name or ROLLBACK TO [SAVEPOINT] name: a request about a savepoint of the current transaction.

Rule: PG-TRANSACTION-004. Mirrors PostgreSQL's TransactionStmt with its savepoint_name. The word SAVEPOINT after RELEASE or ROLLBACK TO, and WORK or TRANSACTION after ROLLBACK, are optional and have no effect; they are not kept. Facts: none; savepoints are the state of a session. Source: https://www.postgresql.org/docs/17/sql-savepoint.html, https://www.postgresql.org/docs/17/sql-release-savepoint.html, https://www.postgresql.org/docs/17/sql-rollback-to.html. Status: Implemented.

Reading a release of a savepointdoctest
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RELEASE SAVEPOINT s');
    [$operation->statement->name->value, $operation->toString()] // => ['s', 'RELEASE s']

Properties§

public Name $name

Methods§

public function __construct(public SavepointAction $action, public Name $name)

Parameters

$actionSavepointActionWhat is done with the savepoint
$nameNameThe savepoint name
public function deriveStatement(Derivation $derivation): void

Derives nothing: savepoints are the state of a session.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 6

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 4
Type declarations 1