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

in_batches method for queries #85

Open
rferg opened this issue Jan 30, 2024 · 0 comments
Open

in_batches method for queries #85

rferg opened this issue Jan 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@rferg
Copy link
Contributor

rferg commented Jan 30, 2024

Add a method like ActiveRecord's in_batches that allows consumers to run a block with each batch of records instead of waiting for the entire result set to resolve before continuing.

We could manually page through the Restforce collection and run the given block on each page. However, providing custom batch sizes per request is complicated. It requires setting this header on the request and Restforce only takes custom headers on client initialization. We won't want to modify this option on a single query because the client is shared.

If a convenient solution to this problem isn't found, we could keep the initial implementation as taking no arguments and uses the current batch size that's set on the client.

@rferg rferg added the enhancement New feature or request label Jan 30, 2024
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

No branches or pull requests

1 participant