classPreparedTransaction
final class PreparedTransaction
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.PREPARE TRANSACTION, COMMIT PREPARED or ROLLBACK PREPARED: a step of a two-phase commit.
Rule: PG-TRANSACTION-005. Mirrors PostgreSQL's TransactionStmt with its gid, the identifier of the prepared transaction as a string. Facts: none; prepared transactions are the state of the server. Source: https://www.postgresql.org/docs/17/sql-prepare-transaction.html, https://www.postgresql.org/docs/17/sql-commit-prepared.html, https://www.postgresql.org/docs/17/sql-rollback-prepared.html. Status: Implemented.
$operation = (new \SqlSemantics\Platform\PostgreSql\Semantics())->analyze("PREPARE TRANSACTION 'tx-1'");
[$operation->statement->identifier->value, $operation->toString()] // => ['tx-1', "PREPARE TRANSACTION 'tx-1'"]Properties§
public PreparedAction $actionpublic StringConstant $identifierMethods§
public function __construct(public PreparedAction $action, public StringConstant $identifier)Parameters
$action | PreparedAction | The step |
$identifier | StringConstant | The identifier of the prepared transaction |
public function deriveStatement(Derivation $derivation): voidDerives nothing: prepared transactions are the state of the server.
Parameters
$derivation | Derivation |
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 2
- method-call Output::keyword() line 51
- function-call
explodeline 51
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
PreparedTransactionTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:88
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:89
- new SqlSemantics\Platform\PostgreSql\Lowering\Utility\TransactionRule::statement() packages/sql-semantics-postgres/src/Lowering/Utility/TransactionRule.php:90