-
Notifications
You must be signed in to change notification settings - Fork 11
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
scan and query always return AsyncIterators #17
base: master
Are you sure you want to change the base?
Conversation
@hayd thanks for ur input, let me try to paper my thoughts: my concern regarding always-ait is that counting like
wouldnt work -
too unintuitive also the scan op is expensive and sth to avoid by db design but need some more thought on this.. |
Whilst it is expensive it's often the case you need more that one page worth. 🤷♂ It would be: const { Count } = await dyno.scan({ TableName: "Tisch", Select: "COUNT" }, { iteratePages: false });
// wouldn't work either, it would be:
const { Count } = await dyno.scanOnce({ TableName: "Tisch", Select: "COUNT" }) I don't think it's dominoes as these are the only two ops that have pagification. You could also do it the other way |
leanin towards preserving |
Is a trick to define a new class that is both awaitable and async iterable? i.e. |
Fixes #4
@chiefbiiko This also makes the DynamoDBClient interface more explicit... This would be a breaking change, but IMO it's a more user-friendly API.
If you wanted convenience functions for scan+query that return Promise we can special case i.e.
(save for a future PR - naming is discussion worthy).