Skip to content

streaming support / generator functions #1715

Open
@ds2345

Description

@ds2345

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 = []) ...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions