classSavepointCommand
final class SavepointCommand
implements Statement
uses Snapshot
@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.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze('RELEASE SAVEPOINT s');
[$operation->statement->name->value, $operation->toString()] // => ['s', 'RELEASE s']Properties§
public SavepointAction $actionpublic Name $nameMethods§
public function __construct(public SavepointAction $action, public Name $name)Parameters
$action | SavepointAction | What is done with the savepoint |
$name | Name | The savepoint name |
public function deriveStatement(Derivation $derivation): voidDerives nothing: savepoints are the state of a session.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 6
- class-const SavepointAction::Define() line 54
- method-call Output::keyword() line 54
- class-const SavepointAction::Release() line 55
- class-const SavepointAction::RollbackTo() line 56
- method-call Output::name() line 58
- class-const NameUse::Column() line 58
Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
SavepointCommandTestcalls
Other tests reaching this symbol 2
Relations§
Instantiated in 4
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:83
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:84
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:85
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::rollbackTo() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:104