oracledb 3.1.2 → 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.
Files changed (53) hide show
  1. package/CHANGELOG.md +277 -4
  2. package/LICENSE.md +5906 -360
  3. package/README.md +7 -8
  4. package/build/Release/oracledb-4.2.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-4.2.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-4.2.0-linux-x64.node +0 -0
  7. package/build/Release/oracledb-4.2.0-linux-x64.node-buildinfo.txt +1 -0
  8. package/build/Release/oracledb-4.2.0-win32-x64.node +0 -0
  9. package/build/Release/oracledb-4.2.0-win32-x64.node-buildinfo.txt +1 -0
  10. package/lib/aqDeqOptions.js +29 -0
  11. package/lib/aqEnqOptions.js +29 -0
  12. package/lib/aqMessage.js +29 -0
  13. package/lib/aqQueue.js +84 -0
  14. package/lib/connection.js +294 -326
  15. package/lib/dbObject.js +144 -0
  16. package/lib/lob.js +125 -132
  17. package/lib/oracledb.js +162 -483
  18. package/lib/pool.js +95 -109
  19. package/lib/{querystream.js → queryStream.js} +31 -30
  20. package/lib/resultset.js +75 -125
  21. package/lib/sodaCollection.js +99 -165
  22. package/lib/sodaDatabase.js +58 -133
  23. package/lib/sodaDocCursor.js +27 -70
  24. package/lib/sodaDocument.js +35 -65
  25. package/lib/sodaOperation.js +96 -252
  26. package/lib/util.js +78 -71
  27. package/package/README.md +41 -36
  28. package/package/install.js +30 -24
  29. package/package.json +2 -2
  30. package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
  31. package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +0 -1
  32. package/build/Release/oracledb-abi48-linux-x64.node +0 -0
  33. package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +0 -1
  34. package/build/Release/oracledb-abi48-win32-x64.node +0 -0
  35. package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +0 -1
  36. package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
  37. package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +0 -1
  38. package/build/Release/oracledb-abi57-linux-x64.node +0 -0
  39. package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +0 -1
  40. package/build/Release/oracledb-abi57-win32-x64.node +0 -0
  41. package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +0 -1
  42. package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
  43. package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +0 -1
  44. package/build/Release/oracledb-abi64-linux-x64.node +0 -0
  45. package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +0 -1
  46. package/build/Release/oracledb-abi64-win32-x64.node +0 -0
  47. package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +0 -1
  48. package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
  49. package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +0 -1
  50. package/build/Release/oracledb-abi67-linux-x64.node +0 -0
  51. package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +0 -1
  52. package/build/Release/oracledb-abi67-win32-x64.node +0 -0
  53. package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +0 -1
package/CHANGELOG.md CHANGED
@@ -1,19 +1,292 @@
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
+
56
+ ## node-oracledb v4.1.0 (26 Nov 2019)
57
+
58
+ - Added end-to-end tracing attributes
59
+ [`connection.clientInfo`](https://oracle.github.io/node-oracledb/doc/api.html#propconnclientinfo)
60
+ and [`connection.dbOp`](https://oracle.github.io/node-oracledb/doc/api.html#propconndbop).
61
+
62
+ - Added support for [Oracle
63
+ Sharding](https://oracle.github.io/node-oracledb/doc/api.html#sharding).
64
+
65
+ - Fixed a [regression](https://github.com/oracle/node-oracledb/issues/1152) when
66
+ binding dates with alternative JavaScript frameworks.
67
+
68
+ - Fixed "NJS-024: memory allocation failed" errors seen on AIX.
69
+
70
+ - Fixed a JavaScript memory leak when getting Oracle Database named type
71
+ information, such as with `getDbObjectClass()`.
72
+
73
+ - Corrected support for PLS_INTEGER and BINARY_INTEGER types when used in PL/SQL
74
+ records ([ODPI-C
75
+ change](https://github.com/oracle/odpi/commit/4e80a81257ce6e1066f4f6242fed533eaed45753)).
76
+
77
+ - Corrected `queryStream()` documentation and examples to show the `'close'`
78
+ event should be received before closing connections. If connections are
79
+ closed on the `'end'` event, then significant C layer memory may be [held
80
+ open](https://github.com/oracle/node-oracledb/issues/1173) until the garbage
81
+ collector frees the associated JavaScript resource.
82
+
83
+ - Reverted the
84
+ [`events`](https://oracle.github.io/node-oracledb/doc/api.html#propdbevents)
85
+ default back to pre-4.0 behavior due to connection creation timeouts in some
86
+ environments. It is now *false* again.
87
+
88
+ - Error changes:
89
+
90
+ - Ensured that `queryStream()` errors raised during close are emitted in the
91
+ `'error'` event.
92
+
93
+ - Enforce only one of `connectString` or `connectionString` being used for
94
+ connection.
95
+
96
+ - Improved some error messages.
97
+
98
+ - Refactored implementation of function argument checking.
99
+
100
+ - Test and documentation improvements.
101
+
102
+ ## node-oracledb v4.0.1 (19 Aug 2019)
103
+
104
+ - Fixed a regression causing a segfault when setting `oracledb.connectionClass`
105
+ and not creating a pool ([ODPI-C change](https://github.com/oracle/odpi/commit/f945355f3e58e7337dd798cba0404ab5755f0692)).
106
+
107
+ - Fixed a regression when enumerable properties were added to
108
+ `Object.prototype`.
109
+ ([#1129](https://github.com/oracle/node-oracledb/issues/1129)).
110
+
111
+ - Fixed a regression with missing `metaData` from `connection.getStatementInfo()`
112
+
113
+ - Fixed crashes with spurious subscription (e.g. CQN) notifications, and when
114
+ unsubscribing an invalid subscription.
115
+
116
+ - A more meaningful error is returned when calling `connection.subscribe()` with
117
+ SQL that is not a SELECT statement ([ODPI-C
118
+ change](https://github.com/oracle/odpi/commit/f95846bef6cf70e8114cbbb59ca04fbe2e7a3903))
119
+
120
+ - Fixed passing DbObjects and JavaScript objects as the `payload` attribute for
121
+ AQ message enqueues when using an object queue.
122
+
123
+ - Made the error message for AQ `queue.deqMany(0)` the same NJS-005 given when a
124
+ negative number is used.
125
+
126
+ - Fixed a compilation warning seen on Windows.
127
+
128
+ - Improve portability of buildbinary.js, a package creation script ([#1129](https://github.com/oracle/node-oracledb/issues/1129)).
129
+
130
+ ## node-oracledb v4.0.0 (25 Jul 2019)
131
+
132
+ - Refactored the node-oracledb implementation to use
133
+ [N-API](https://nodejs.org/api/n-api.html) in place of
134
+ [NAN](https://github.com/nodejs/nan).
135
+ - Node-oracledb 4 requires Node.js 8.16 or Node.js 10.16, or higher. Node.js 8.16, 10.16, 11.12 and 12 contain an important N-API performance fix.
136
+ - N-API allows node-oracledb binaries to be portable between Node.js versions on a given operating system, subject to N-API compatibility. Node-oracledb uses N-API version 4.
137
+ - Oracle Client libraries are still required at runtime. These can be from Oracle Instant Client, the full Oracle Client, or an Oracle Database installation.
138
+ - The string representation of classes has changed to `[object Object]` as a consequence of using N-API. Use `Object.getPrototypeOf()` to get class information.
139
+ - The C compiler required for building from source code no longer needs C++11 compatibility. The node-oracledb source code is now pure C.
140
+
141
+ - Added support for querying and binding [Oracle Database Objects and
142
+ Collections](https://oracle.github.io/node-oracledb/doc/api.html#objects).
143
+
144
+ - Added support for [Oracle Advanced Queuing (AQ)](https://oracle.github.io/node-oracledb/doc/api.html#aq):
145
+
146
+ - Added support for "RAW" queues, allowing String and Buffer
147
+ messages to be used.
148
+
149
+ - Added support for object queues, allowing Oracle Database object
150
+ messages to be used.
151
+
152
+ - Added support for notifications with `oracledb.SUBSCR_NAMESPACE_AQ`.
153
+
154
+ - Added support for [Implicit
155
+ Results](https://oracle.github.io/node-oracledb/doc/api.html#implicitresults),
156
+ allowing query results to be returned from PL/SQL without needing
157
+ parameters or bind variables.
158
+
159
+ - Added asynchronous method
160
+ [`lob.getData()`](https://oracle.github.io/node-oracledb/doc/api.html#lobgetdata)
161
+ to return all data from a Lob readable stream.
162
+
163
+ - Added a new `dbTypeName` attribute to [`extendedMetaData`
164
+ output](https://oracle.github.io/node-oracledb/doc/api.html#execmetadata).
165
+ It contains the name of the type the column has in the database,
166
+ such as "VARCHAR2".
167
+
168
+ - Enhanced BIND_IN of PL/SQL Collection Associative Arrays (Index-by)
169
+ so a bind definition object can be omitted (see
170
+ [#1039](https://github.com/oracle/node-oracledb/issues/1039)).
171
+
172
+ - Continuous Query Notification (CQN) Improvements:
173
+
174
+ - Added support for getting the [registration
175
+ id](https://oracle.github.io/node-oracledb/doc/api.html#consubscribecallback)
176
+ for CQN subscriptions.
177
+
178
+ - Added support and message type constants for database startup
179
+ and shutdown events.
180
+
181
+ - Fixed a crash that occurred when unsubscribing from CQN while
182
+ notifications were ongoing ([ODPI-C
183
+ change](https://github.com/oracle/odpi/commit/b96b11b7fe58f32f011c7f7419555e40268d5bf4)).
184
+
185
+ - Added
186
+ [`connection.currentSchema`](https://oracle.github.io/node-oracledb/doc/api.html#propconncurrentschema)
187
+ for setting the schema qualifier to be used when a qualifier is
188
+ omitted in SQL statements. This is an efficient alternative to
189
+ `ALTER SESSION SET CURRENT_SCHEMA`.
190
+
191
+ - Renumbered [node-oracledb Type
192
+ Constants](https://oracle.github.io/node-oracledb/doc/api.html#oracledbconstantsnodbtype)
193
+ and [Oracle Database Type
194
+ Constants](https://oracle.github.io/node-oracledb/doc/api.html#oracledbconstantsdbtype)
195
+ to allow for future enhancements.
196
+
197
+ - Introduced [Query `outFormat`
198
+ Constants](https://oracle.github.io/node-oracledb/doc/api.html#oracledbconstantsoutformat)
199
+ `oracledb.OUT_FORMAT_ARRAY` and `oracledb.OUT_FORMAT_OBJECT`. The
200
+ previous constants `oracledb.ARRAY` and `oracledb.OBJECT` are
201
+ deprecated but still usable.
202
+
203
+ - Improved the performance of [`oracledb.outFormat`](#propdboutformat) mode `oracledb.OUT_FORMAT_OBJECT`.
204
+
205
+ - Improved the fetch performance of LOBs in some cases by reducing the
206
+ number of round-trips required between node-oracledb and Oracle
207
+ Database ([ODPI-C
208
+ change](https://github.com/oracle/odpi/commit/58e6a07ff5bb428a09068456ef5231884fcb77db)).
209
+
210
+ - Change the
211
+ [`events`](https://oracle.github.io/node-oracledb/doc/api.html#propdbevents)
212
+ default to *true*.
213
+
214
+ - Updated the JavaScript syntax in class implementations.
215
+
216
+ - Class methods are now configurable. For example via
217
+ `Object.defineProperty`.
218
+
219
+ - Error handling changes:
220
+
221
+ - Corrected the error message returned when invalid types are used for
222
+ boolean options.
223
+
224
+ - Standardized error messages for incorrect function parameters. Now
225
+ NJS-005 and NJS-007 are used in place of NJS-006 and NJS-008,
226
+ respectively.
227
+
228
+ - Exceptions from user getters for parameter object attribute access
229
+ are now passed through the error callback.
230
+
231
+ - The NJS-014 error when setting a read-only property was replaced
232
+ with a standard JavaScript message.
233
+
234
+ - When passing 0 or a negative value for the number of iterations to
235
+ `connection.executeMany()`, errors now occur through the error callback.
236
+
237
+ - Some error numbers may have changed due to code refactoring.
238
+ Some message text was updated.
239
+
240
+ - [SODA](https://oracle.github.io/node-oracledb/doc/api.html#sodaoverview) changes:
241
+
242
+ - Added SODA bulk insert methods
243
+ [`sodaCollection.insertMany()`](https://oracle.github.io/node-oracledb/doc/api.html#sodacollinsertmany)
244
+ and
245
+ [`sodaCollection.insertManyAndGet()`](https://oracle.github.io/node-oracledb/doc/api.html#sodacollinsertmanyandget).
246
+
247
+ - Document that the general SODA API is out of Preview status when
248
+ using Oracle Client 18.5 or Oracle Client 19.3, or later. The
249
+ new node-oracledb 4.0 methods `sodaCollection.insertMany()` and
250
+ `sodaCollection.insertManyAndGet()` are in Preview status and
251
+ should not be used in production.
252
+
253
+ - Corrected the type of
254
+ [`sodaCollection.metaData`](https://oracle.github.io/node-oracledb/doc/api.html#sodacollectionpropmetadata).
255
+ It is now an Object, as was documented.
256
+
257
+ - Corrected processing of the `force` option in SODA [`sodaCollection.dropIndex()`](https://oracle.github.io/node-oracledb/doc/api.html#sodacolldropindex).
258
+
259
+ - Corrected the error message parameter number for SODA
260
+ [`sodaDatabase.getCollectionNames()`](https://oracle.github.io/node-oracledb/doc/api.html#sodadbgetcollectionnames).
261
+
262
+ - Fixed writing of multi-byte characters to CLOBs when multiple writes
263
+ are required.
264
+
265
+ - Fixed a crash occurring when draining the connection pool ([ODPI-C
266
+ change](https://github.com/oracle/odpi/commit/https://github.com/oracle/odpi/commit/7666dc3208087383f7f0f5e49c1ee423cb154997)).
267
+
268
+ - Corrected `pool.status` to be read-only, as was documented.
269
+
270
+ - Updated documentation.
271
+
272
+ - Added new tests.
273
+
274
+ - Added new examples. Updated existing examples to the Node.js 8 Async/Await style of programming.
275
+
3
276
  ## node-oracledb v3.1.2 (22 Feb 2019)
4
277
 
5
278
  - Fixed a bug causing CQN crashes when multiple queries are registered
6
279
  ([ODPI-C change](https://github.com/oracle/odpi/issues/96)).
7
280
 
8
281
  - Fixed a CQN race condition to prevent a crash when a multiple
9
- `conn.unsubscribe()` calls are made on the same subscription.
282
+ `connection.unsubscribe()` calls are made on the same subscription.
10
283
 
11
284
  - Improved validation of `executeMany()` arguments to prevent a crash.
12
285
 
13
286
  - Standardized error message for SODA `createCollection()` with
14
287
  invalid metadata.
15
288
 
16
- - Correct the DPI-1050 error text displayed when the Oracle Client
289
+ - Corrected the DPI-1050 error text displayed when the Oracle Client
17
290
  libraries are too old ([ODPI-C change](https://github.com/oracle/odpi/commit/d2fea3801286d054e18b0102e60a69907b7faa9a)).
18
291
 
19
292
  - Allow `npm run buildbinary` to succeed even if `git` is not
@@ -127,12 +400,12 @@
127
400
  ## node-oracledb v3.0.0 (1 Oct 2018)
128
401
 
129
402
  - Added new APIs for Simple Oracle Document Access
130
- ([SODA](https://github.com/oracle/node-oracledb/blob/master/doc/api.md#sodaoverview)),
403
+ ([SODA](https://oracle.github.io/node-oracledb/doc/api.html#sodaoverview)),
131
404
  available when using Oracle Database 18.3 and Oracle client
132
405
  libraries version 18.3, or later.
133
406
 
134
407
  - Added a `drainTime` argument to
135
- [`pool.close()`](https://github.com/oracle/node-oracledb/blob/master/doc/api.md#poolclose),
408
+ [`pool.close()`](https://oracle.github.io/node-oracledb/doc/api.html#poolclose),
136
409
  allowing pools to be force-closed after a specified number of
137
410
  seconds. PR #950 (Danilo Silva).
138
411