Skip to content

Conversation

@pmorris-dev
Copy link
Contributor

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

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
Copy link
Contributor

jjhafer commented Dec 26, 2025

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