Swift-Kuery
Swift-Kuery copied to clipboard
Support for fetching N rows at a time instead of all together
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.
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.
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