Skip to content

Faster result processing using USE RESULT #3367

Open
@infusion

Description

@infusion

Hi,

thank you very much for the mysql2 library! I have a question that if not currently possible could be turned into a feature request. I want to process large streams of data from MySQL. The MySQL CLI client allows to add the -q option for avoiding buffering and PHP for example allows to add the result mode MYSQLI_USE_RESULT to stream the data. I only found a way to stream data using mysql2, but what I'm looking for is a way to run a query without buffering, optimally like so:

db = await mysql.createConnection({...})

for await (let row of db.query("SELECT * FROM t1")) {...} 

Is this already possible or is something in this direction already planned?

Thanks!
Robert

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions