I mean this Node.js SQLite each.
Wonder if it is possible to use async iterator and call,
for await (const r of SQL_STATEMENT) {
}
Or perhaps some other conveniences, like subscribe or observable?
I mean this Node.js SQLite each.
Wonder if it is possible to use async iterator and call,
for await (const r of SQL_STATEMENT) {
}
Or perhaps some other conveniences, like subscribe or observable?
For further actions, you may consider blocking this person and/or reporting abuse
Julian Martinez -
John Brooks -
Guillaume Sere -
Rigal Patel -
Top comments (3)
The meat of
Database#each
is implemented in C++ unfortunately:github.com/mapbox/node-sqlite3/blo...
Essentially the callback is sent over to the C++ side and scheduled over there.
Not sure how the C++ side can pass an async generator back to JavaScript.
This might be of use to you.
How to create an SQLite database in node.js
dev.to/forbeslindesay/how-to-creat...
Maybe atdatabases support async iterator via SQLQuery.querystream; but I am not so sure. Maybe tutorial is missing in this aspect.
The best (and simplest) driver for SQLite in Node.js would still be better-sqlite3.
Still, you have done well wrapping around
pg
(and also with TypeScript typings). I will have to borrow it for PostgreSQL.