-
Notifications
You must be signed in to change notification settings - Fork 71
feat(core): receive query result using async iterable #592
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
Conversation
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #592 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 33 35 +2
Lines 1333 1446 +113
Branches 323 344 +21
==========================================
+ Hits 1333 1446 +113
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
01cd744
to
1a5553e
Compare
9e5d9c1
to
0cf8cc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome improvements! 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR 👍 There is only minor requirement:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍻
dfcf4d1
to
cbe6076
Compare
Nice! Just what i was searching for. Thanks. |
Fixes #581
The main goal of this PR is to allow developers to consume query results using async iterable:
All the details are demonstrated in updated examples. The present approach (with an observable) is still valid in many use cases, it is however more verbose and a bit harder to use in an asynchronous context.
Proposed Changes
for-await
loop)implement it in both node.js and browser transport
AnnotatedCSVResponse
to return iterable of lines or rowsQueryApi
to return CSV results lines or rows using async iterable (newiterateLines
anditerateRows
method)query.ts
example was reorganized a bit so that top-level await is avoided (not supported by esbuild yet)queryWithParameters.mjs
now uses async iterables in a top-levelfor-await
loop, which is possible when executing directly with node.jsinvokableScripts.mjs
uses async iterable, it is thus a bit simplerfollow-redirects.mjs
now demosntrate arowMapper
functionindex.html
is indented and produces better console logsfor-await
loops, it was es2015 before this PR ...Checklist
yarn test
completes successfully