mariadb-corporation / mariadb-connector-nodejs

MariaDB Connector/Node.js is used to connect applications developed on Node.js to MariaDB and MySQL databases. MariaDB Connector/Node.js is LGPL licensed.
GNU Lesser General Public License v2.1
366 stars 91 forks source link

Please update the documentation. Since Node v10.0.0, for-await-of is available. #189

Closed ganlvtech closed 1 year ago

ganlvtech commented 2 years ago

https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/0ec7eeaa9e1224520129bba0a0f78f33d0fca072/documentation/promise-api.md#L763

Since Node v10.0.0, for-await-of is available.

async function doSomeQuery() {
  const readable = connection.queryStream("SELECT * FROM mysql.user");
  for await (const row of readable) {
    console.log(row);
  }
}

See https://nodejs.org/api/stream.html#readablesymbolasynciterator

rusher commented 1 year ago

closing since corrected last year