oracledb 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # Change Log
2
2
 
3
+ ## node-oracledb v4.2.0 (24 Jan 2020)
4
+
5
+ - Added support for binding using the node-oracledb [Database Type
6
+ Constants](https://oracle.github.io/node-oracledb/doc/api.html#oracledbconstantsdbtype)
7
+ `DB_TYPE_DATE`, `DB_TYPE_CHAR`, `DB_TYPE_NCHAR`, `DB_TYPE_NVARCHAR`,
8
+ `DB_TYPE_NCLOB`, `DB_TYPE_BINARY_DOUBLE`, `DB_TYPE_BINARY_FLOAT`,
9
+ `DB_TYPE_BINARY_INTEGER`, `DB_TYPE_TIMESTAMP`, and `DB_TYPE_TIMESTAMP_TZ`.
10
+
11
+ - Added support for binding using `DB_TYPE_BOOLEAN` (Diego Arce).
12
+
13
+ - Added support for creating temporary NCLOBS with
14
+ [`connection.createLob(oracledb.NCLOB)`](https://oracle.github.io/node-oracledb/doc/api.html#connectioncreatelob).
15
+
16
+ - Added [client initiated
17
+ connection](https://oracle.github.io/node-oracledb/doc/api.html#consubscribeoptclientinitiated)
18
+ support for Continuous Query Notification (CQN) and other subscription based
19
+ notifications.
20
+
21
+ - Added
22
+ [`result.lastRowid`](https://oracle.github.io/node-oracledb/doc/api.html#execlastrowid)
23
+ to `execute()`. It contains the ROWID of the last row affected by an INSERT,
24
+ UPDATE, DELETE or MERGE statement.
25
+
26
+ - Changed the Error object
27
+ [`offset`](https://oracle.github.io/node-oracledb/doc/api.html#properroffset)
28
+ to be 32-bit, allowing the
29
+ [`batchErrors`](https://oracle.github.io/node-oracledb/doc/api.html#executemanyoptbatcherrors)
30
+ mode of `executeMany()` to show row `offset` values up to (2^32)-1 ([ODPI-C
31
+ change](https://github.com/oracle/odpi/commit/294d5966cd513d0c29fdeec3bbbdfad376f81d4f)).
32
+
33
+ - Avoid intermediate conversion from the database national character set to the
34
+ database character set when querying NCLOB columns as String.
35
+
36
+ - Fixed various execution failures with Node.js 13.2 due to a Node.js NULL pointer behavior change ([ODPI-C
37
+ change](https://github.com/oracle/odpi/commit/7693865bb6a98568546aa319cc0fdb9e208cf9d4)).
38
+
39
+ - Fixed connection pooling so sharded `pool.getConnection()` requests respect
40
+ `queueTimeout` when `poolMaxPerShard` has been reached.
41
+
42
+ - Added a directory to the binary module search to help Webpack use, though a
43
+ copy plugin is still required, see
44
+ [here](https://github.com/oracle/node-oracledb/issues/1156#issuecomment-571554125).
45
+
46
+ - Fixed some static code analysis warnings.
47
+
48
+ - Updated Lob streaming documentation and examples. Applications should use the
49
+ `end` event (for readable streams) and `finish` event (for writeable streams)
50
+ instead of the `close` event. The node-oracledb `lob.close()` method is now
51
+ deprecated in favor of the more functional Node.js 8 Stream `destroy()`
52
+ method.
53
+
54
+ - Test and documentation improvements.
55
+
3
56
  ## node-oracledb v4.1.0 (26 Nov 2019)
4
57
 
5
58
  - Added end-to-end tracing attributes
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # node-oracledb version 4.1
1
+ # node-oracledb version 4.2
2
2
 
3
3
  The node-oracledb add-on for Node.js powers high performance Oracle
4
4
  Database applications.
5
5
 
6
- Use node-oracledb 4.1 to connect Node.js 8.16, 10.16, 12, or later, to Oracle Database.
6
+ Use node-oracledb 4.2 to connect Node.js 8.16, 10.16, 12, or later, to Oracle Database.
7
7
  Older versions of node-oracledb may work with older versions of Node.js.
8
8
 
9
9
  Node-oracledb supports basic and advanced features of Oracle Database
@@ -43,7 +43,7 @@ have been made by the community.
43
43
 
44
44
  ## <a name="license"></a> License
45
45
 
46
- Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
46
+ Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
47
47
 
48
48
  You may not use the identified files except in compliance with the Apache
49
49
  License, Version 2.0 (the "License.")
@@ -0,0 +1 @@
1
+ oracledb-4.2.0-darwin-x64.node v12.14.0 da38f81a6d5a455470eeac591d361d840f9d7ff7 3bfc57e44f88465440b046ff70be38097d2d4fd7 Thu, 16 Jan 2020 06:03:53 GMT
@@ -0,0 +1 @@
1
+ oracledb-4.2.0-linux-x64.node v10.18.1 da38f81a6d5a455470eeac591d361d840f9d7ff7 3bfc57e44f88465440b046ff70be38097d2d4fd7 Thu, 16 Jan 2020 06:04:31 GMT
@@ -0,0 +1 @@
1
+ oracledb-4.2.0-win32-x64.node v13.5.0 da38f81a6d5a455470eeac591d361d840f9d7ff7 3bfc57e44f88465440b046ff70be38097d2d4fd7 Thu, 16 Jan 2020 05:59:23 GMT
package/lib/connection.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved
1
+ // Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -244,6 +244,8 @@ function createLob(type, createLobCb) { //eslint-disable-line
244
244
  const self = this;
245
245
 
246
246
  nodbUtil.checkAsyncArgs(arguments, 2, 2);
247
+ nodbUtil.assert(typeof type === 'number', 'NJS-005', 1);
248
+ nodbUtil.assert(typeof createLobCb === 'function', 'NJS-005', 2);
247
249
 
248
250
  self._createLob.apply(self, arguments);
249
251
  }
package/lib/lob.js CHANGED
@@ -69,6 +69,18 @@ class Lob {
69
69
  this.getData = nodbUtil.promisify(oracledb, getData);
70
70
  }
71
71
 
72
+ // called by stream.destroy() and ensures that the LOB is closed if it has
73
+ // not already been closed (never called directly)
74
+ _destroy(err, cb) {
75
+ this._close(function(closeErr) {
76
+ if (closeErr) {
77
+ cb(closeErr);
78
+ } else {
79
+ cb(err);
80
+ }
81
+ });
82
+ }
83
+
72
84
  // implementation of streaming read; if lob is set to auto-close, the lob is
73
85
  // automatically closed within the C++ code when an error occurs or when
74
86
  // there are no more bytes to transfer; all that needs to be done in the JS
package/lib/oracledb.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved
1
+ // Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -59,7 +59,10 @@ const defaultPoolAlias = 'default';
59
59
  const binaryLocations = [
60
60
  '../' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE, // pre-built binary
61
61
  '../' + nodbUtil.RELEASE_DIR + '/' + 'oracledb.node', // binary built from source
62
- '../build/Debug/oracledb.node' // debug binary
62
+ '../build/Debug/oracledb.node', // debug binary
63
+ // Ease Webpack use, see https://github.com/oracle/node-oracledb/issues/1156
64
+ './node_modules/oracledb/' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE,
65
+ './node_modules/oracledb/' + nodbUtil.RELEASE_DIR + '/' + 'oracledb.node'
63
66
  ];
64
67
 
65
68
  let oracledbCLib;
@@ -71,7 +74,7 @@ for (let i = 0; i < binaryLocations.length; i++) {
71
74
  if (err.code !== 'MODULE_NOT_FOUND' || i == binaryLocations.length - 1) {
72
75
  let nodeInfo;
73
76
  if (err.code === 'MODULE_NOT_FOUND') {
74
- // none of the three binaries could be found
77
+ // a binary was not found in any of the search directories
75
78
  nodeInfo = `\n Looked for ${binaryLocations.map(x => require('path').resolve(__dirname, x)).join(', ')}\n ${nodbUtil.getInstallURL()}\n`;
76
79
  } else {
77
80
  nodeInfo = `\n Node.js require('oracledb') error was:\n ${err.message}\n ${nodbUtil.getInstallHelp()}\n`;
@@ -171,9 +174,22 @@ function createPool(poolAttrs, createPoolCb) {
171
174
  // be called by the database when a connection acquired from the pool doesn't
172
175
  // have the requested tag
173
176
  sessionCallback = poolAttrs.sessionCallback;
177
+
178
+ // create an adjusted set of pool attributes to pass to the C layer; the
179
+ // session callback must be removed if it is a JavaScript function and the
180
+ // queue timeout is used to specify the maximum amount of time that the C
181
+ // layer will wait for a connection to be returned; ordinarily since the
182
+ // JavaScript layer never calls the C layer to get a connection unless one is
183
+ // known to be available, this should not be needed, but in some cases (such
184
+ // as when the maximum for a particular shard is specified) this may not be
185
+ // known, so this prevents an unnecessarily long wait from taking place
186
+ const adjustedPoolAttrs = Object.defineProperties({},
187
+ Object.getOwnPropertyDescriptors(poolAttrs));
174
188
  if (typeof poolAttrs.sessionCallback === 'function') {
175
- poolAttrs = Object.assign({}, poolAttrs);
176
- delete poolAttrs.sessionCallback;
189
+ delete adjustedPoolAttrs.sessionCallback;
190
+ }
191
+ if (adjustedPoolAttrs.queueTimeout === undefined) {
192
+ adjustedPoolAttrs.queueTimeout = self.queueTimeout;
177
193
  }
178
194
 
179
195
  // Need to prevent another call in the same stack from succeeding, otherwise
@@ -183,7 +199,7 @@ function createPool(poolAttrs, createPoolCb) {
183
199
  tempUsedPoolAliases[poolAlias] = true;
184
200
  }
185
201
 
186
- self._createPool(poolAttrs, function(err, poolInst) {
202
+ self._createPool(adjustedPoolAttrs, function(err, poolInst) {
187
203
  if (err) {
188
204
  // We need to free this up since the creation of the pool failed.
189
205
  if (poolAlias) {
@@ -205,7 +221,6 @@ function createPool(poolAttrs, createPoolCb) {
205
221
  delete tempUsedPoolAliases[poolAlias];
206
222
  }
207
223
 
208
- poolAttrs.sessionCallback = sessionCallback;
209
224
  poolInst._setup(poolAttrs, poolAlias, self);
210
225
 
211
226
  poolInst.on('_after_close', function() {
@@ -81,25 +81,25 @@ function done(err) {
81
81
 
82
82
  if (process.platform === 'linux') {
83
83
  if (process.arch === 'x64') {
84
- clientUrl = 'https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html';
84
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html';
85
85
  } else {
86
- clientUrl = 'https://www.oracle.com/technetwork/topics/linuxsoft-082809.html';
86
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/linux-x86-32-downloads.html';
87
87
  }
88
88
 
89
89
  log('** - Oracle Client libraries (' + arch + ') must be configured with ldconfig or LD_LIBRARY_PATH');
90
90
  log('** - To get libraries, install an Instant Client Basic or Basic Light package from');
91
91
  log('** ' + clientUrl);
92
92
  } else if (process.platform === 'darwin') {
93
- clientUrl = 'https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
93
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html';
94
94
  installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html#instosx';
95
95
 
96
96
  log('** - Oracle Instant Client Basic or Basic Light package libraries must be in ~/lib or /usr/local/lib');
97
97
  log('** Download from ' + clientUrl);
98
98
  } else if (process.platform === 'win32') {
99
99
  if (process.arch === 'x64') {
100
- clientUrl = 'https://www.oracle.com/technetwork/topics/winx64soft-089540.html';
100
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html';
101
101
  } else {
102
- clientUrl = 'https://www.oracle.com/technetwork/topics/winsoft-085727.html';
102
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/microsoft-windows-32-downloads.html';
103
103
  }
104
104
 
105
105
  log('** - Oracle Client libraries (' + arch + ') must be in your PATH environment variable');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "A Node.js module for Oracle Database access",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "http://oracle.github.io/node-oracledb/",
@@ -1 +0,0 @@
1
- oracledb-4.1.0-darwin-x64.node v12.13.1 e734ca522dcb428a60cd3cae544b8b26ca9bd1d4 cbdd015ded87785e85b409fcf73aaedbadd0780d Thu, 21 Nov 2019 05:02:32 GMT
@@ -1 +0,0 @@
1
- oracledb-4.1.0-linux-x64.node v10.17.0 e734ca522dcb428a60cd3cae544b8b26ca9bd1d4 cbdd015ded87785e85b409fcf73aaedbadd0780d Thu, 21 Nov 2019 05:10:19 GMT
@@ -1 +0,0 @@
1
- oracledb-4.1.0-win32-x64.node v12.13.0 e734ca522dcb428a60cd3cae544b8b26ca9bd1d4 cbdd015ded87785e85b409fcf73aaedbadd0780d Thu, 21 Nov 2019 05:11:15 GMT