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.

LGPL-2.1 License

Downloads
445.3K
Stars
369
Committers
32

Bot releases are visible (Hide)

mariadb-connector-nodejs - MariaDB Connector/Node.js 3.3.1 Latest Release

Published by dbart 4 months ago

3.3.1 (May 2024)

Full Changelog

Issues Fixed

  • CONJS-288 ensure pool timeout error give details #268
  • CONJS-289 connection possibly staying in hanging state after batch execution #281
  • CONJS-290 possible ECONRESET when executing batch #281
  • CONJS-292 ensure String object parameter
  • CONJS-286 exchanges stop when closing prepare and prepareCacheLength is set to 0
  • CONJS-287 typescript missing queryoption for prepare command
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.3.0

Published by dbart 7 months ago

3.3.0 (Mar 2024)

Full Changelog

Notable changes

  • CONJS-284 pipeline PREPARE and EXECUTE
  • CONJS-264 TLS ephemeral certificate automatic implementation
  • CONJS-279 Improve text encoding decoding

Issues Fixed

  • CONJS-281 cannot connect to 11.3+ server with character-set-collations = utf8mb4=uca1400_ai_ci
  • CONJS-277 using connection.importFile when connection is not connected to database result in error
  • CONJS-278 Possible buffer overwrite when sending query bigger than 16M
  • CONJS-282 error when using mysql_clear_test password authentication plugin
  • CONJS-283 wrong decoding of binary unsigned MEDIUMINT
  • CONJS-285 DECIMAL field wrong decoding with deprecated option 'supportBigNumbers' set
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.2.3

Published by dbart 10 months ago

3.2.3 (Dec 2023)

Full Changelog

  • CONJS-207 Add support for connection redirection
  • CONJS-271 wrong binary decoding of 00:00:00 TIME values
  • CONJS-272 Error doesn't always have parameters according to option
  • CONJS-273 Bulk insert error when last bunch of parameters is reaching max_allowed_packet
  • CONJS-274 permit disabling BULK insert for one batch
  • CONJS-207 Add support for connection redirection
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.2.2

Published by dbart about 1 year ago

3.2.2 (Oct 2023)

Full Changelog

Issues Fixed

  • CONJS-270 Always send connection attributes, even when connectAttributes is not set
  • CONJS-269 avoid useless "set names utf8mb4" on connection creation if not needed
  • CONJS-268 importFile method doesn't always throw error when imported commands fails #253
  • CONJS-267 Ensure that option collation with id > 255 are respected
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.2.1

Published by dbart about 1 year ago

3.2.1 (Sep 2023)

Full Changelog

Notable changes

  • CONJS-262 Binary result-set parsing performance improvement, avoiding to chromium slow issue https://bugs.chromium.org/p/v8/issues/detail?id=7161
  • CONJS-265 permit configuration of console warning message to be exported
  • CONJS-266 Option infileStreamFactory addition for compatibility

Issues Fixed

  • CONJS-261 TypeScript missing logParam connection option
  • CONJS-263 ensure respecting server collation
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.2.0

Published by dbart over 1 year ago

3.2.0 (Jun 2023)

Full Changelog

Notable changes

  • CONJS-250 'undefined' parameters are now permitted, for compatibility with mysql/mysql2 behavior
  • CONJS-257 permit to import sql file directly

new APIs:

importFile(options) → Promise
connection.importFile({file:'...', 'database': '...'}) → Promise
pool.importFile({file:'...', 'database': '...'}) → Promise

example:

    await conn.importFile({
        file: '/tmp/someFile.sql', 
        database: 'myDb'
    });

Issues Fixed

  • CONSJ-252 missing deprecated option supportBigNumbers and bigNumberStrings in Typescript
  • CONJS-254 ensuring option connectTimeout is respected : timeout is removed when socket is successfully established, in place of returning connection object. Wasn't set when using pipe/unix socket
  • CONJS-255 In some case, pipelining was use even option explicitly disable it
  • CONJS-256 method changeUser can lead to error when using multi-authentication and pipelining
  • CONJS-258 All eventEmitters methods are not available on connections
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.1.2

Published by dbart over 1 year ago

3.1.2 (May 2023)

Full Changelog

Notable changes

  • CONJS-249 add connection.listeners function to permit TypeORM compatibility

Issues Fixed

  • CONJS-247 Improve error message when having set named parameter option and executing standard question mark command
  • CONJS-248 Ensuring not using importing file after pool.end()
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.1.1

Published by dbart over 1 year ago

3.1.1 (Mar 2023)

Full Changelog

Issues Fixed

  • CONJS-246 pool not listening to 'error' event might exit application on error
  • CONJS-240 Repeating calling the same procedure gets a release prepare error.
  • CONJS-244 correction for node.js 12 compatibility
  • CONJS-245 batch failing when using bulk and metaAsArray
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.1.0

Published by dbart over 1 year ago

3.1.0 (Feb 2023)

Full Changelog

Notable changes

Timezone handling (CONJS-237)

Connector now set session timezone, solving issue with time function,
removing needs of client side conversion.

This requires that when using timezone options, to having server TZ data filled in case client timezone differ from server.

Performance

  • CONJS-230 better metadata parsing performance
  • CONJS-229 performance improvement when parsing lots of parameter
  • CONJS-238 faster execution for known length packet

Other changes

  • CONJS-225 Make result set's meta property non-enumerable
  • CONJS-235 Allow to pass TypeScript generic types without need of "as"

Issues Fixed

  • CONJS-231 executing batch and when parameter can be too long to fit in one mysql packet, parameter can have 4 byte missing
  • CONJS-236 datatype TIME wrong binary decoding when not having microseconds
  • CONJS-239 When using connection with callback, pre-commands (like initSql) might not always be executed first
  • CONJS-232 in case of a long query running, connection.destroy() will close connection, but leaving server still running query for some time
  • CONJS-240 adding a Prepare result wrapper to avoid multiple close issue with cache
  • CONJS-241 metaAsArray missing option in typescript description
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.0.2

Published by dbart almost 2 years ago

3.0.2 (Oct 2022)

Full Changelog

Notable changes

  • CONJS-222 permit streaming prepare statement result
    example :
const prepare = await shareConn.prepare('SELECT * FROM mysql.user where host = ?');
const stream = prepare.executeStream(['localhost']);    
try {
  for await (const row of stream) {
    console.log(row);
  }
} catch (e) {
  queryStream.close();
}
prepare.close();

Issues Fixed

  • CONJS-223 Metadata column name gets sporadic corrupted
  • CONJS-211 Session timezone unset on connection re-use with connection pool
  • CONJS-212 when throwing an error when using option leakDetectionTimeout, might result in throwing wrong error with Cannot read properties of null (reading 'leaked')
  • CONJS-217 caching_sha2_password never succeed using FAST AUTHENTICATION. With correction, one less exchanges is done when connecting to a MySQL server
  • CONJS-219 prepare cache was not limited to prepareCacheLength but can increase up to 2x the prepareCacheLength value, leading to possible ER_MAX_PREPARED_STMT_COUNT_REACHED
  • CONJS-228 improving prepare cache performance
  • CONJS-226 missing typescript metaAsArray option and documentation
  • CONJS-213 update error code with recent MariaDB server
  • CONJS-215 Executing after prepare close throw an undescriptive error
  • CONJS-221 option debugLen and logParam are not documented
  • CONJS-227 Allow setting idleTimeout to 0
  • CONJS-214 missing pool.closed typescript definition
  • CONJS-216 remove please-upgrade-node dependency
  • CONJS-224 missing typescript checkNumberRange option definition
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.0.1 GA

Published by dbart about 2 years ago

3.0.1 (Jul 2022)

Full Changelog

Notable changes

  • Error description improvement
    • Pool might return a common error ‘retrieve connection from pool timeout after XXXms’ in place of real error.[CONJS-200]
    • [CONJS-209] Trace option now works when using pool/cluster. It is recommended to activate the trace option in development Since driver is asynchronous, enabling this option to save initial stack when calling any driver methods. This allows having the caller method and line in the error stack, permitting error easy debugging. The problem is this error stack is created using Error.captureStackTrace that is very very slow. To give an idea, this slows down by 10% a query like 'select * from mysql.user LIMIT 1', so not recommended in production.
      const pool = mariadb.createPool({
      host: 'mydb.com',
      user: 'myUser',
      connectionLimit: 5,
      trace: true
      });
      await pool.query('wrong query');
      /* will throw an error like :
        SqlError: (conn=15868, no: 1064, SQLState: 42000) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'wrong query' at line 1
          sql: wrong query - parameters:[]
            at Object.module.exports.createError (errors.js:57:10)
            at ...
          From event:
            at Function._PARAM (\integration\test-pool.js:60:18)
            at …
          text: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'wrong query' at line 1",
          sql: 'wrong query - parameters:[]',
          fatal: false,
          errno: 1064,
          sqlState: '42000',
          code: 'ER_PARSE_ERROR'
      */
      
    • Pool error description is improved indicating pool information, like [CONJS-208]:
      SqlError: (conn=-1, no: 45028, SQLState: HY000) retrieve connection from pool timeout after 200ms
        (pool connections: active=1 idle=0 limit=1)
        at Object.module.exports.createError
      
  • node.js 18 supported [CONJS-197]
  • New option checkNumberRange. When used in conjunction of decimalAsNumber, insertIdAsNumber or bigIntAsNumber, if conversion to number is not exact, connector will throw an error [CONJS-198]. This permits easier compatibility with mysql/mysql2 and 2.x version driver version.
  • Performance enhancement for multi-rows resultset. Internal benchmarks show improved performance by 10% for a result-set of 1000 rows.[CONJS-210]

Issues Fixed

  • Wrong error returned "Cannot read properties of undefined… … (reading 'charset')" when error during handshake [CONJS-193]
  • [CONJS-194] Charset change using parameterized query fails with "Uncaught TypeError: opts.emit is not a function"
  • [CONJS-195] Error "cannot mix BigInt and other types" when parsing negative bigint
  • [CONJS-196] connection.close() is now really an alias or connection.release()
  • [CONJS-199] wrong return type for batch() on typescript
  • [CONJS-201] typecast geometry parsing error
  • [CONJS-202] support pre 4.1 error format for 'too many connection' error
  • [CONJS-203] encoding error for connection attributes when using changeUser with connection attributes
  • [CONJS-206] possible race condition on connection destroy when no other connection can be created
  • [CONJS-204] handle password array when using authentication plugin “pam_use_cleartext_plugin”
  • [CONJS-205] query hanging when using batch with option timeout in place of error thrown
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.0.0 GA

Published by dbart over 2 years ago

3.0.0 (Jan 2022)

Full Changelog

  • merged correction from 2.5.6
  • [CONJS-185] considering BIT(1) as boolean (option bitOneIsBoolean permit to disable that behavior for compatibility)
  • reliability: pool ensuring multi-request process order
  • performance: set parser function once per result-set
  • documentation improvement
mariadb-connector-nodejs - MariaDB Connector/Node.js 2.5.6

Published by dbart over 2 years ago

2.5.6 (Jan 2022)

Full Changelog

  • [CONJS-181] Local infile file validation doesn't take in account escaped value
  • [CONJS-183] change default connection timeout value 1 second to permit pools to send correct error
  • update documentation with for-await-of use #189
  • correct character_set_client unexpect error parsing OK_Packet #177
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.0.0 RC

Published by dbart almost 3 years ago

3.0.0-rc (19 Oct 2021)

Full Changelog

Notable change:

  • [CONJS-168] stream backpressure not handled well
  • [CONJS-172] performance improvement for multi-line result-set + update perf result with recent mysql/mysql2 drivers see dedicated part results.
  • [CONJS-168] correct stream backpressure
  • [CONJS-176] Change Pool cluster default option removeNodeErrorCount value to Infinity
  • [CONJS-175] Missing leakDetectionTimeout option in Typescript description
  • [CONJS-178] Update code to recent Ecma version
  • [CONJS-179] better pool option resetAfterUse default value
  • [CONJS-180] compatibility: support mysql2 stream option
  • Corrections:
  • [CONJS-125] permit using batch with returning clause
  • [CONJS-170] Pool.query(undefined) never release connection
  • [CONJS-173] not permitting providing null as a value without an array
mariadb-connector-nodejs - MariaDB Connector/Node.js 2.5.5

Published by dbart almost 3 years ago

2.5.5 (19 Oct 2021)

Full Changelog

  • [CONJS-170] Pool.query(undefined) never release connection
  • [CONJS-173] not permitting providing null as a value without an array
  • [CONJS-175] Missing leakDetectionTimeout option in Typescript description
mariadb-connector-nodejs - MariaDB Connector/Node.js 3.0.0 Beta

Published by dbart over 3 years ago

3.0.0-beta (11 Jun 2021)

Full Changelog

Migrating from 2.x or mysql/mysql2 driver have some breaking changes, see dedicated part documentation.

  • [CONJS-153] support Prepared statement with 10.6 new feature metadata skip
  • [CONJS-165] Adding initial message error value on Error object
  • [CONJS-166] Restrict authentication plugin list
  • [CONJS-167] Permit custom logger configuration
  • [CONJS-168] correct stream backpressure

New Connection options

option description type default
insertIdAsNumber Whether the query should return last insert id from INSERT/UPDATE command as BigInt or Number. default return BigInt boolean false
decimalAsNumber Whether the query should return decimal as Number. If enable, this might return approximate values. boolean false
bigIntAsNumber Whether the query should return BigInt data type as Number. If enable, this might return approximate values. boolean false
logger Permit custom logger configuration. For more information, see the logger option documentation. mixed
prepareCacheLength Define prepare LRU cache length. 0 means no cache int 256

new Connection methods

This methods are compatible with mysql2 with some differences:

  • permit streaming parameters
  • execute use by default a prepared cache that hasn't infinite length.
  • implement mariadb 10.6 skipping metadata when possible for better performance
  • Doesn't have a unprepare methods.
mariadb-connector-nodejs - MariaDB Connector/Node.js 2.5.4

Published by dbart over 3 years ago

2.5.4 (08 Jun 2021)

Full Changelog

  • [CONJS-163] Authentication plugin failing doesn't always return error
  • [CONJS-164] Add API that list options default value
  • [CONJS-161] Runtime error on escape() method when escaping array parameter type
  • update iconv-lite dependency to 0.6.3
mariadb-connector-nodejs - MariaDB connector/node.js 2.5.3

Published by rusher over 3 years ago

This version is a correction release (Stable (GA)).

Full Changelog

  • [CONJS-157] Batch error when setting maxAllowedPacket less than an insert parameter value
  • [CONJS-158] use BigInt constructor in place of literal to ensure maximum compatibility
  • [CONJS-160] Wrong definition for typescript PoolConnection.release
  • [CONJS-159] test 10.6 server latest build
mariadb-connector-nodejs - MariaDB connector/node.js 2.5.2

Published by rusher almost 4 years ago

This version is a correction release (Stable (GA)).

Full Changelog

  • [CONJS-151] bulk batch error (parameter truncation) #137
  • [CONJS-152] correction when enabling the permitLocalInfile option and some initial commands
  • [CONJS-154] Timezone support correction and clarification
  • [CONJS-155] correction to support for node.js 10.13 to 10.19
  • [CONJS-156] Ensure setting capability PLUGIN_AUTH only if server has it

documentation improvement

mariadb-connector-nodejs - MariaDB connector/node.js 2.5.1

Published by rusher almost 4 years ago

This version is a correction release (Stable (GA)).

Full Changelog

  • CONJS-149 correcting possible TypeError [ERR_UNKNOWN_ENCODING], Node v15 compatibility