Skip to main content

Module tx

Module tx 

Source
Expand description

The rules of an interactive transaction, as a pure state machine: what an open or failed transaction admits, where it stands afterwards, and which savepoints it holds. Whatever holds the connection applies them.

Enums§

Next
Where the slot goes after an operation.
Outcome
How an operation that ran came back: fine, refused before reaching the server (the transaction is untouched), or failed on the server (which aborts the transaction).
Phase
Where an open transaction stands. After a statement error Postgres has aborted the transaction and only a rollback (to a savepoint or whole) is accepted.
SavepointOp
SlotOp

Functions§

admit
Whether op may run in phase; a failed transaction answers every statement, savepoint and release with the error Postgres would give.
in_failed_transaction
What a failed transaction answers until it is rolled back.
invalid_savepoint
isolation_sql
next
The slot’s phase after an admitted op ran with outcome. Commit and rollback end the transaction whatever happened; a server error inside it aborts it; a successful rollback to a savepoint recovers it.
parameters_outside_transaction
Parameters on a statement that cannot be prepared inside a transaction.
rolled_back_by_commit
A COMMIT of a failed transaction, which the server answers by rolling it back.
savepoint_sql
The SQL for a savepoint operation, when the name it refers to exists: RELEASE and ROLLBACK TO an unknown savepoint would abort the whole transaction on the server, so they are refused first.
savepoints_after
The savepoint stack after a successful operation: RELEASE drops the savepoint and every later one, ROLLBACK TO keeps it and drops the later ones.
transaction_control_refused
Transaction control inside a statement, which the host owns.
transaction_limit
transaction_not_found
unknown_savepoint
valid_savepoint
Savepoint names are interpolated into SQL, so only the SDK’s own sp_{depth} shape is accepted.