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

creating queryIterable method #66

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

Farenheith
Copy link

The added method aims to offer a seamless way to obtain paginated results from Athena through the async iterable contract.

It abstracts the nextToken manipulation making the call for paginated results much simpler, like in the example below:

async function main() {
    const results = athenaExpress.queryIterable("SELECT * from students LIMIT 100", 10);
	for await (const page of results) {
    	  console.log(page.Items);
	}
}
main();

The default pagination value (the method second parameter) is 999, because 1000 are throwing an error due to the paginationFactor treatment in the getQueryResultsFromS3 method.

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