Top features: Promise support. Node 6 support.
The new node-oracledb 1.9.1 release adds Promise support, it now supports the new Node 6 (as well as previous releases), and it has some welcome stability fixes. Other nice goodies are mentioned below. Thanks to everyone who gave feedback on our 1.9.0 development branch - we couldn't have done it without you.
Promise support was added. All asynchronous functions can now optionally return Promises. When asynchronous functions are passed with a callback function parameter, the familiar callback flow is used. If the callback parameter is omitted, then a Promise is returned. There are some examples in the examples directory, see promises.js and webapppromises.js.
Node Promises allow a programming paradigm that many Node users find comfortable. Some users had implemented their own Promise wrappers for node-oracledb; a few had even been published on NPM. Now the official implementation makes Promises available to everyone.
The default Promise library is used for Node 0.12, 4, 5 and 6. It can be easily overridden if you wish to incorporate your own implementation. This is also useful for Node 0.10 where there is no native library.
It can also be used with ResultSets from top-level queries, allowing them to be converted to streams. However the existing
connection.queryStream() method will probably be easier to use in this scenario.
connection.close() have been added for
connection.release() respectively. This should make it easier to remember which method to use for releasing a connection, terminating a connection pool, or closing a ResultSet: you can just use
An experimental query Stream
_close() method was added. It allows query streams to be closed without needing to fetch all the data. It is marked experimental because there isn't good information about how safe interrupting the current Node Streams implementation is.
pause(), if necessary. On Node 0.10 you may get a pause event even if you had previously paused the stream. This is because Node 0.10 doesn't support the
Upgraded to NAN 2.3 for Node 6. This removes the deprecation warnings that Node 6 was generating with the older NAN 2.2.
Older versions of Node can still be used, of course.
A similar change was made to Lob buffers used during LOB insertion.
Fixed some memory leaks when using ResultSets.
Fixed a memory leak with the Pool queue timer map.
Fixed memory release logic when querying LOBs and an error occurs.
Removed an extra call to
getRows() made by
queryStream() at end-of-fetch.
Some method parameter validation checks, such as the number or types of parameters, will now throw errors synchronously instead of returning errors via the callback.
Improved validation for
Increased the internal buffer size for Oracle Database error messages.
Altered some node-oracledb NJS-xyz error message text for consistency.
The test suite is no longer automatically installed when installing with
npm install oracledb from NPM. The test suite was (and will be) getting bigger and bigger. It is not being used by most people, so installing it automatically is wasteful.
You can still run the tests using a GitHub clone. The updated test README has instructions for this. To allow tests to be moved and run anywhere, we left the tests'
require('oracledb') calls without a path prefix so you may need to set
NODE_PATH as described.
Fixed a symbol name redefinition warning for
DATA_BLOB when compiling on Windows.
Overall node-oracledb 1.9.1 is a significant milestone with the addition of Promise support, the support for Node 6, and the general resiliency changes. I'm very happy with this release and would encourage upgrading to it.
What's next? There are still lots of enhancements for node-oracledb on the wish list. Please let us know your priorities.
Issues and questions about node-oracledb can be posted on GitHub. Your input helps us schedule work on the add-on. Drop us a line!