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

A request to undo the changes made since a savepoint, keeping the transaction open.

Rule: SQLITE-ROLLBACK-TO-001. The savepoint stays on the transaction stack. The SAVEPOINT keyword before the name is optional and is not written. SQLite reads a name after TRANSACTION and ignores it. Savepoints are connection state, so whether the name exists is not a fact of the model. Source: https://sqlite.org/lang_savepoint.html. Status: Implemented.

Reading the savepoint a rollback returns todoctest
$rollback = (new \SqlSemantics\Platform\Sqlite\Semantics())->analyze('ROLLBACK TO SAVEPOINT before_import');
    [$rollback->statement->savepoint->value, $rollback->toString()] // => ['before_import', 'ROLLBACK TO before_import']

Properties§

public Name $savepoint
public Name|null $name = null

Methods§

public function __construct(public Name $savepoint, public Name|null $name = null)

Parameters

$savepointNameThe savepoint to return to
$nameName|nullThe name written after TRANSACTION, which SQLite ignores
public function deriveStatement(Derivation $derivation): void

Derives nothing: the request depends on no declaration.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

Test cases 2§

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 1

Relations§

Instantiated in 1