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

Support for fetching N rows at a time instead of all together #11

Open
ianpartridge opened this issue Nov 16, 2016 · 2 comments
Open

Support for fetching N rows at a time instead of all together #11

ianpartridge opened this issue Nov 16, 2016 · 2 comments
Labels

Comments

@ianpartridge
Copy link
Contributor

Does Swift-Kuery support pagination? For example, suppose you have a query which returns 1,000 results.

You might want a way to iterate through chunks of results using a cursor pattern. This would avoid loading all 1,000 results into memory at once.

@na-gupta
Copy link
Contributor

This would be useful for applications that work on large tables (say a million records) and need to process them in small batches (say 1000 at a time), so as to not load all of them into memory at the same time.

@na-gupta na-gupta changed the title Pagination support Support for fetching N rows at a time instead of all together Nov 16, 2016
@rfdickerson
Copy link
Contributor

Yeah, that's a good plan- I have faced the need for something like this since I've hooked in Swift-Kuery to the Swift Package Catalog data. I think we would need to just add offset to the already existing limit capability.

https://www.postgresql.org/docs/8.3/static/queries-limit.html

irar2 added a commit that referenced this issue Nov 17, 2016
irar2 added a commit to Kitura/Swift-Kuery-PostgreSQL that referenced this issue Nov 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants