Files
synapse/rust
Erik JohnstonandClaude Opus 4.8 29fe27d40e Wire up Connection.run_interaction
Add the high-level entry point that ties the cursor and transaction
lifecycle together: `run_interaction(func, *args, **kwargs)` opens a cursor
(starting a transaction), invokes `func(cursor, *args, **kwargs)`, then
commits if the callback returns normally and rolls back if it raises,
propagating the callback's return value back to Python. This mirrors
Synapse's existing `run_interaction` API.

A `CursorGuard` is held for the duration so that an unexpected unwind
(panic) before `finish` still rolls the transaction back; a `finish` error
takes precedence over the callback's result, since on such an error the
transaction outcome is unknown and the connection is closed.

This is the caller that `cursor`/`finish`/`CursorGuard` were waiting for,
so their transitional `#[allow(dead_code)]` attributes are removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-06 09:44:51 +00:00
..
2026-07-06 09:44:51 +00:00