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

streaming support / generator functions #1715

Open
ds2345 opened this issue Aug 13, 2023 · 0 comments · May be fixed by #1776
Open

streaming support / generator functions #1715

ds2345 opened this issue Aug 13, 2023 · 0 comments · May be fixed by #1776

Comments

@ds2345
Copy link

ds2345 commented Aug 13, 2023

Summary

is there a way to fetch results of select statement one by one, instead of all at once, by using javascript generator functions?
(those functions that internally use yield statement)

I am aware that .each() function can handle reading rows one by one by using callbacks,
but callbacks get complicated when used in async/await environment.
I tried converting ".each()" callbacks to promise and to generator function, but so far this didn't work.

So are generator functions already possible (and how), or could they be added to the core library?

Proposed implementation

something like

function* selectEach(query, params = []) ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant