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

Adding support for batch size for SOQL #84

Open
raunakbagri opened this issue Sep 1, 2020 · 5 comments
Open

Adding support for batch size for SOQL #84

raunakbagri opened this issue Sep 1, 2020 · 5 comments

Comments

@raunakbagri
Copy link

Currently, if we Query the Sobjects, the size of the result is 2000 which is the default batch size.
However, we can change this batch by using header as mentioned here: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/headers_queryoptions.htm

Need an interface to support the above.

@jesperfj
Copy link
Owner

jesperfj commented Sep 4, 2020

Do you find that you need to set different batch sizes all the time? Or would it be acceptable to set the batch size on the Config object?

@raunakbagri
Copy link
Author

Setting different batch size gives more flexibility as we would making soql on various collections, giving us an option to fine tune the performance.

@jesperfj
Copy link
Owner

jesperfj commented Sep 6, 2020

Can you give some pseudo code samples of how you would like it to work?

@jesperfj
Copy link
Owner

jesperfj commented Sep 6, 2020

I am leaning heavily towards providing this in ApiConfig and I am looking to understand whether that would be unreasonably burdensome

@raunakbagri
Copy link
Author

raunakbagri commented Sep 6, 2020

I understand your viewpoint.

Just an example of my usecase: I make SOQL with batch sizes varying from collections to collections.

Some objects can be processed asynchronously so batch size won't matter. (Maybe in future to tune the backend optimisation, I might need the batch size)

Some are rendered on the UI and needs pagination. These can be configured differently for the different pages fetching and rendering respective objects. (Pages for two different collections can be configured with different pagination size).

So only I was suggesting argument based interface. I agree with having a default value set in the ApiConfig as it would be useful for many, but the former one shall give amazing flexibility.

eg.

QueryResult query(String query, Class clazz, int batchSize);
QueryResult queryMore(String nextRecordsUrl, Class clazz, int batchSize);

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

No branches or pull requests

2 participants