Skip to main content

Module transaction

Module transaction 

Source
Expand description

Backend-aware transaction-control helpers.

Lifted from copy.rs so that callers outside the copy module (notably the CLI query command’s --begin/--commit/--rollback wiring) can drive the same BEGIN / COMMIT / ROLLBACK statements without depending on copy.rs internals.

The string-statement chosen per backend mirrors what copy.rs already issues; Oracle has no explicit BEGIN (implicit txn), so begin_transaction is a noop that still returns true so the caller’s wrapping COMMIT/ROLLBACK at the end terminates the implicit transaction.

Functions§

begin_transaction
Open a target-side transaction. Returns true if the BEGIN succeeded, false if the backend rejected the statement (best- effort: the caller proceeds without a wrapping transaction).
commit_transaction
Commit the wrapping transaction. Blocking: one synchronous COMMIT round-trip.
rollback_transaction
Roll back the wrapping transaction. Blocking: one synchronous ROLLBACK round-trip.