new methods connection.prepare, connection.execute, connection.unprepare like mysql2 API.
Implementation differ compared to mysql2 :
* support binary batching
* support streaming parameters
* cache is not infinite: using a LRU cache (option `cacheLen`, default to 256, 0 meaning no cache).
* Implement MariaDB 10.6 new feature permitting to skip metadata if cached, server sending only the raw data for faster results
Actual timezone support has 2 issues,
* use of moment.setDefault that can be changed by the environment.
* when using timezone, connection default timezone is not set, possibly causing issue with function sensible to timezone, like NOW()
connection timezone is now set by default. If server doesn't recognized timezone format,
a warning will be issued. This setting can be disabled using option `skipSetTimezone`
BigInt is a built-in object that provides a way to represent whole numbers larger than 2^53 - 1, which is the largest number JavaScript can reliably represent with the Number primitive and represented by the Number.MAX_SAFE_INTEGER constant. BigInt can be used for arbitrarily large integers.
There is 3 different parts in implementation:
* BigInt parameters are now supported.
* resultset that have data of MariaDB BIGINT type will be returned as BigInt type in place of Number.
* UPSERT query resulting insertId has BigInt format
This is only enabled when option `supportBigInt` is enable for compatibility with previous implementation. When enable, option `supportBigNumbers` has no used anymore.
This will be the default in next MAJOR 3.x version.
When using pool cluster, goal is to avoid reusing server that are down.
Defaulting to 0, failing pool is retried each time a new connection is asked. This permit to blacklist pool for some time.
This option is only permitted for MariaDB server >= 10.1.2, and permits to set a timeout to query operation.
Driver internally use `SET STATEMENT max_statement_time=<timeout> FOR <command>` permitting to cancel operation when timeout is reached,
Implementation of max_statement_time is engine dependent, so there might be some differences: For example, with Galera engine, a commits will ensure replication to other nodes to be done, possibly then exceeded timeout, to ensure proper server state.
A new option `leakDetection` permits to indicate a timeout to log connection borrowed from pool.
When a connection is borrowed from pool and this timeout is reached, a message will be logged to console indicating a possible connection leak.
Another message will tell if the possible logged leak has been released.
A value of 0 (default) meaning Leak detection is disable
Additionally, some error messages have improved:
- Connection timeout now indicate that this correspond to socket failing to establish
- differentiate timeout error when closing pool to standard connection retrieving timeout
Goal is to correct wrong behaviour when setting restoreNodeTimeout:
cluster isn't blacklisting node if the option "removeNodeErrorCount"
was set, only after number of error reach "removeNodeErrorCount" value.
Correction is to make that corresponds to documentation: when a node
fails, it will be blacklisted, so the connection will be done on other
nodes. If "removeNodeErrorCount" value is set and reached, the node will
be removed.
new options :
- idleTimeout: Indicate idle time after which a pool connection is released. Value must be lower than @@wait_timeout. In seconds (0 means never release)
- minimumIdle: Permit to set a minimum number of connection in the pool.
In case of failover, pool now wait for some small time before the next connection creation, avoiding using CPU for no reason.