Skip to content

creating queryIterable method#66

Open
Farenheith wants to merge 6 commits into
ghdna:masterfrom
Farenheith:master
Open

creating queryIterable method#66
Farenheith wants to merge 6 commits into
ghdna:masterfrom
Farenheith:master

Conversation

@Farenheith
Copy link
Copy Markdown

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