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.

Reading the identifier of a prepared transactiondoctest
$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 $action
public StringConstant $identifier

Methods§

public function __construct(public PreparedAction $action, public StringConstant $identifier)

Parameters

$actionPreparedActionThe step
$identifierStringConstantThe identifier of the prepared transaction
public function deriveStatement(Derivation $derivation): void

Derives nothing: prepared transactions are the state of the server.

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 3