sidorares / sidorares/node-mysql2
Faster result processing using USE RESULT
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 680
- Avg merge
- 9h 7m
- Merged PRs (30d)
- 59
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining mysql2's existing streaming API and the query execution path to determine how result buffering is handled. Compare the requested async-iterator usage with the current streaming behavior; done means an unbuffered query mode can process large MySQL result sets incrementally with documented behavior and coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- mysql, nodejs, typescript
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100