Skip to content

feat: support interruptible transactions#18

Merged
jjhafer merged 1 commit into
silvermine:masterfrom
pmorris-dev:support_interruptible_transactions
Dec 26, 2025
Merged

feat: support interruptible transactions#18
jjhafer merged 1 commit into
silvermine:masterfrom
pmorris-dev:support_interruptible_transactions

Conversation

@pmorris-dev

@pmorris-dev pmorris-dev commented Dec 25, 2025

Copy link
Copy Markdown
Contributor

Also added support for rolling back active transactions (interruptible ones and regular ones), when the app is about to exit.

@pmorris-dev pmorris-dev force-pushed the support_interruptible_transactions branch from 251b302 to 67515c4 Compare December 25, 2025 22:31
@jjhafer

jjhafer commented Dec 26, 2025

Copy link
Copy Markdown
Contributor

The API looks straightforward and easy to use. I hadn't really thought of this use-case as an "interruptible" transaction that requires a "continue", but more of the ability to perform logic and reads during a transaction. My initial hang-up was probably recency bias where statements are passed in via a closure or callback like:

db.transaction({ tx in
    tx.executeSomeWrite()
    <some logic>
    tx.executeSomeRead()
    <some logic>
    tx.executeSomeWrite()
    tx.commit() or tx.rollback()
})

But I don't know if the above is a good pattern in Rust. Anyway, the clear API you wrote seems like a good place to start. Thanks for the good driving directions!

@jjhafer jjhafer self-requested a review December 26, 2025 14:59
@jjhafer jjhafer merged commit a66d621 into silvermine:master Dec 26, 2025
1 check passed
@pmorris-dev pmorris-dev deleted the support_interruptible_transactions branch December 26, 2025 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants