Conversation
- Now supports [prepared](https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_sql/prepare/#box-sql-box-prepare) SQL statements. - Huge rewrite of the codebase, which improved performance by N%: - Now using 'msgpackr' instead of 'msgpack-lite' - Buffer reuse - Decreased memory consumption - New AutoPipelining mode: send a batch of commands periodically with no need to rewrite your existing code. Benchmark showed x3 performance for the Select requests: - 330k/sec without AutoPipelining - 1100k/sec with AutoPipelining period set to ~10ms - [IPROTO_ID](https://www.tarantool.io/en/doc/latest/reference/internals/iproto/requests/#iproto-id) can be invoked as 'conn.id()' function. - [Streams](https://www.tarantool.io/en/doc/latest/platform/atomic/txn_mode_mvcc/#streams-and-interactive-transactions) support.
### <b>BREAKING</b>
- `nonWritableHostPolicy` is deprecated and no more supported due to the overhead, low-frequency usability and complexity. Finally, it may be better to handle the connection's 'close' errors by developer and reconnect.
- For a syntax clearance and new features you should pass parameters of `eval` and `call` methods as an array, e.g.:
```javascript
tarantool.eval('return ...', [a, b])
```
instead of the previous:
```javascript
tarantool.eval('return ...', a, b)
```
- Dropping support for old Node.JS versions:
now this module is guaranteed to work on a `Maintenance`, `Active` and `Current` [versions](https://nodejs.org/en/about/previous-releases#release-schedule) in order to introduce new features and stability.
- `selectCb()` method is deprecated. This (`.select()`) and all other commands now can be invoked in a callback style (but `then/catch`-style is also supported, just don't specify the `cb` parameter and the function will return a Promise):
```javascript
tarantool.select(
spaceId,
indexId,
limit,
offset,
iterator,
key,
opts,
(error, success) => {
// process the result as usual
}
)
```
### Bug fixes
- Fixed bug of a buffer reuse approach
- Fixed use of keepAlive and noDelay
- Fixed use of Transactions if connection is not inited yet
- Fixed memory leak of 'connect' / 'close' events (appeared during many reconnects)
### Improvements
- Optimized offline queue
- New option `tupleToObject`, which allows you to receive an array of objects instead of array of arrays:
- Keys are similar to the Tarantool space's key names, and value is a corresponding value from the tuple
- Note that there is an extra overhead of converting array to object
- This option is usable only for the following request types: `select`, `update`, `delete`, `insert`, `replace`
- Introduced 2 custom error classes, which are exported on the connector class. They are useful for a better development experience when you can handle errors more properly:
- ReplyError: errors created by the Tarantool server in a similar [format](https://www.tarantool.io/ru/doc/latest/reference/internals/msgpack_extensions/#the-error-type)
- TarantoolError: general errors thrown by the driver
- New option `commandTimeout` to define the max execution time of the sent request. Can be configured on the class globally or per each command
- `packDecimal()` function now also accepts BigInt
- Improved performance of the built-in MsgPack extensions (used in a `packDecimal()`, `packUuid()`, etc)
- Improved compression of the 'update' / 'upsert' operations by converting a string field names to their corresponding ID's
- New iterators: OVERLAPS and NEIGHBOR
- Extended tests (with help of a native `node:test` and `node:assert`)
- Updated benchmarks, README, eslint config
- New guides
- Even better performance
- New `.quit()` method - awaits for the sent commands to become fullfilled before the connection closes
- Pipeline response is now an instance of `PipelineResponse` with 2 additional methods: `findPipelineError()` and `findPipelineErrors()`
Fix tests
Fix support for NodeJS v20
|
Thank you for the patch! Please, split the PR into individual parts with different functionality. As example, you could create a separate PR for a separate bug, than an another one, and another one... In its current form, PR is difficult to review and it can take too much time without any progress. See: https://github.com/tarantool/tarantool/wiki/Code-review-procedure?ysclid=mm1tddvaqi260159427#commit-message |
|
You're partly right, but there were some reasons for that. First, this was development for internal needs. It wasn't considered necessary to publish every update to you. Overall, the functionality is compatible (except for |
4.0.0
BREAKING
nonWritableHostPolicyis deprecated and no more supported due to the overhead, low-frequency usability and complexity. Finally, it may be better to handle the connection's 'close' errors by developer and reconnect.evalandcallmethods as an array, e.g.:now this module is guaranteed to work on a
Maintenance,ActiveandCurrentversions in order to introduce new features and stability.selectCb()method is deprecated. This (.select()) and all other commands now can be invoked in a callback style (butthen/catch-style is also supported, just don't specify thecbparameter and the function will return a Promise):Bug fixes
Improvements
tupleToObject, which allows you to receive an array of objects instead of array of arrays:select,update,delete,insert,replacecommandTimeoutto define the max execution time of the sent request. Can be configured on the class globally or per each commandpackDecimal()function now also accepts BigIntpackDecimal(),packUuid(), etc)node:testandnode:assert).quit()method - awaits for the sent commands to become fullfilled before the connection closesPipelineResponsewith 2 additional methods:findPipelineError()andfindPipelineErrors()