Comments (3)
if your node >= 10.x I prefer use this for-await-of loop
for await (const row of connection.queryStream(cmd)) {
console.log(row);
}
connection.end();
from mariadb-connector-nodejs.
I tend to agree with @victor0801x using standard es2018 asynchronous iteration seem more appropriate, even if requiring node.js 10+.
Implementation is for the moment not as performant compared to event
I mean :
for await (const row of connection.queryStream(cmd)) {
console.log(row);
}
connection.end();
is less performant compared to
connection.queryStream(cmd)
.on('data', row => {
console.log(row);
})
.on('end', () => {
connection.end();
});
but is more readable
from mariadb-connector-nodejs.
Thank you, @rusher
from mariadb-connector-nodejs.
Related Issues (20)
- 3.2.2 Packets out of Order error inserting large document on Linux. Same code works with 2.5.6 on Linux and 3.2.2. on Windows HOT 3
- TypeError: Cannot read properties of undefined (reading '0') : Inserting rows with batch. HOT 5
- Connection stops responding after exception thrown by 'batch' operation. HOT 1
- Feature Request: Copy cmdParams to custom error logger HOT 2
- batch result insertId should be last one or documentation should be updated HOT 1
- TIME format 00:00:00 return 102278627328:00:34 HOT 1
- batch bulk insert gaps HOT 13
- Best option connection with PHP 8.3 HOT 1
- Issue with a client... for some reason got those strange messages. HOT 4
- importFile throws when default database was not set HOT 1
- Big Array Batch Not Support HOT 1
- retrieve connection from pool timeout HOT 6
- Read-only Connections (feature request) HOT 2
- can I disable prepare when use execute ? HOT 2
- Unexpected symbol 'n' in int\bigint field HOT 2
- Large Insert never completes with .batch() and node 3.2.3 HOT 3
- Insert of Long Rows causes "ECONNRESET" or "Got packets out of order" with 3.2.3. Same code works with 2.5.6 HOT 4
- Insert fails with SQL Error with mariadb 3.2.3 on Linux. Same code works with 2.5.6 on Linux and works with 3.2.3 on Windows HOT 7
- COALESCE returning string instead of number when comparing SIGNED and UNSIGNED HOT 2
- decimal values still string in result of query with decimalAsNumber true HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mariadb-connector-nodejs.