Download | Release Notes | Changelog |
Release date: 20 Oct 2021
MariaDB Connector/Node.js 3.0.0-rc is an RC release.
Do not use non-stable (non-GA) releases in production!
For an overview of MariaDB Connector/Node.js see the page
see 3.0.0-beta for 3.0.0 content from previous version.
Before 3.0, implementation ensure connection state, at the cost of not handling backpressure well.
Streaming a resultset ensured the connection state before version 3.0, at the cost of not handling backpressure well. Since the goal of queryStream is to avoid the use of a large amount of memory, handling of backpressure has been optimized. If data handling takes some amount of time, the socket is paused to avoid the node socket buffer growing indefinitely. This has an impact on the use of function stream.pipeline as queryStream now needs to be closed explicitly to ensure that a connection is not in a wrong state ( unhandled rows in the socket buffer). Example
pool cluster option removeNodeErrorCount now default to infinity. This avoids having pool removed from cluster when a server temporarily fails.
pool option resetAfterUse now default to false. This permit avoids executing a command each time a connection is returned to pool.
[],[]
The pool cluster option removeNodeErrorCount now defaults to infinity. This avoids that some pool is removed from the cluster when a server temporarily fails.
The pool option resetAfterUse now defaults to false. This avoids the execution of a COM_RESET each time a connection is returned to the pool.
The option stream provides a way to execute a function with a callback parameter before each connection stream creation.
This can permit setting a SSH Tunnel for example:
[] Batch operations now support the returning clause (example command like insert into XXX values (?,?,?) returning id)
[] permit using batch with returning clause
[] Pool.query(undefined) never release connection
[] not permitting providing null as a value without an array
For a complete list of changes made in this release, with links to detailed information on each push, see the .
[CONJS-178] Update code to recent Ecma version
[CONJS-172] performance improvement for multi-line result-set
stream
permits to set a function with parameter to set stream (since 3.0)
function
const queryStream = connection.queryStream("SELECT * FROM mysql.user");
stream.pipeline(queryStream, transformStream, someWriterStream, (err) => { queryStream.close(); });const mariadb = require('mariadb');
const tunnel = require('tunnel-ssh');
const fs = require('fs');
const conn = await mariadb.createConnection({
user: 'dbuser',
password: 'dbpwd',
port: 27000,
stream: (cb) =>
tunnel(
{
// remote connection ssh info
username: 'sshuser',
host: '157.230.123.7',
port: 22,
privateKey: fs.readFileSync('./key.ppk'),
// database (here on ssh server)
dstHost: '127.0.0.1',
dstPort: 3306,
// local interface
localHost: '127.0.0.1',
localPort: 27000
},
cb
)
});This page is: Copyright © 2025 MariaDB. All rights reserved.