Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use transactionSync API for transaction rollbacks #13

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

Brayden
Copy link
Member

@Brayden Brayden commented Oct 6, 2024

Based on feedback from an opened issue, Cloudflare's SQLite API actually does support transaction blocks by default! The code changes here wrap all transaction queries in the new transactionSync(() => { }) which we now return the callback altogether which includes the results.

This removes our previous implementation code where we manually created expensive bookmarks before each transaction operation occurred.

Resolves: #12

@Brayden Brayden self-assigned this Oct 6, 2024
@Brayden Brayden added the enhancement New feature or request label Oct 6, 2024
@kentonv
Copy link

kentonv commented Oct 7, 2024

expensive bookmarks

For what it's worth, creating a bookmark is basically free, it's only actually restoring to it that's expensive.

@Brayden Brayden merged commit 640d36c into main Oct 8, 2024
@Brayden Brayden deleted the bwilmoth/transaction-support branch October 8, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DO has a transactions API (and we... forgot to document it... sorry)
2 participants