Skip to content

[Feature] getNextCrudTransactionBatch #593

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

stevensJourney
Copy link
Collaborator

@stevensJourney stevensJourney commented May 12, 2025

Overview

Some users have requested the ability to batch upload multiple transactions using the uploadData handler. However, the existing getNextCrudBatch and getNextCrudTransaction methods make this process somewhat cumbersome.

  • getNextCrudBatch does not group items by transaction, and completing the batch removes all of its CRUD items from the queue. This makes it difficult for developers to fetch and complete a batch corresponding to multiple related transactions.

  • getNextCrudTransaction returns only the CRUD entries for a single transaction. Developers are effectively forced to upload transactions one at a time, as repeated calls will continue to return the first pending transaction until it has been completed.

This PR introduces a new method, getNextCrudTransactionBatch (name subject to change), which returns a CrudBatch containing items from multiple CRUD transactions. This allows for more efficient and flexible batch uploads.

Related to #415

Copy link

changeset-bot bot commented May 12, 2025

🦋 Changeset detected

Latest commit: 3fcb6cb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@powersync/common Minor
@powersync/web Minor
@powersync/node Minor
@powersync/react-native Minor
@powersync/op-sqlite Patch
@powersync/tanstack-react-query Patch
@powersync/diagnostics-app Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

1 participant