oracledb 6.4.0 → 6.5.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 (58) hide show
  1. package/README.md +2 -2
  2. package/build/Release/oracledb-6.5.0-darwin-x64.node +0 -0
  3. package/build/Release/oracledb-6.5.0-darwin-x64.node-buildinfo.txt +1 -0
  4. package/build/Release/oracledb-6.5.0-js-buildinfo.txt +1 -0
  5. package/build/Release/oracledb-6.5.0-linux-arm64.node +0 -0
  6. package/build/Release/oracledb-6.5.0-linux-arm64.node-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-6.5.0-linux-x64.node +0 -0
  8. package/build/Release/oracledb-6.5.0-linux-x64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.5.0-win32-x64.node +0 -0
  10. package/build/Release/oracledb-6.5.0-win32-x64.node-buildinfo.txt +1 -0
  11. package/lib/aqQueue.js +1 -1
  12. package/lib/connection.js +11 -14
  13. package/lib/errors.js +24 -2
  14. package/lib/impl/connection.js +2 -1
  15. package/lib/impl/datahandlers/constants.js +6 -5
  16. package/lib/impl/datahandlers/oson.js +301 -150
  17. package/lib/impl/datahandlers/vector.js +3 -22
  18. package/lib/oracledb.js +11 -1
  19. package/lib/pool.js +7 -1
  20. package/lib/settings.js +1 -0
  21. package/lib/thin/connection.js +23 -52
  22. package/lib/thin/pool.js +62 -6
  23. package/lib/thin/protocol/capabilities.js +17 -5
  24. package/lib/thin/protocol/constants.js +14 -2
  25. package/lib/thin/protocol/messages/auth.js +1 -1
  26. package/lib/thin/protocol/messages/base.js +8 -10
  27. package/lib/thin/protocol/messages/dataType.js +1 -0
  28. package/lib/thin/protocol/messages/execute.js +5 -1
  29. package/lib/thin/protocol/messages/{connectionCookie.js → fastAuth.js} +18 -16
  30. package/lib/thin/protocol/messages/fetch.js +4 -0
  31. package/lib/thin/protocol/messages/index.js +2 -2
  32. package/lib/thin/protocol/messages/protocol.js +9 -1
  33. package/lib/thin/protocol/messages/withData.js +2 -5
  34. package/lib/thin/protocol/packet.js +35 -4
  35. package/lib/thin/protocol/protocol.js +10 -5
  36. package/lib/thin/protocol/utils.js +11 -18
  37. package/lib/thin/sqlnet/constants.js +5 -2
  38. package/lib/thin/sqlnet/ezConnectResolver.js +9 -5
  39. package/lib/thin/sqlnet/navNodes.js +4 -3
  40. package/lib/thin/sqlnet/networkSession.js +14 -3
  41. package/lib/thin/sqlnet/packet.js +2 -5
  42. package/lib/thin/statement.js +36 -0
  43. package/lib/thin/statementCache.js +34 -11
  44. package/lib/thin/util.js +2 -2
  45. package/lib/transformer.js +9 -3
  46. package/lib/types.js +9 -1
  47. package/lib/util.js +1 -1
  48. package/lib/version.js +1 -1
  49. package/package.json +1 -1
  50. package/build/Release/oracledb-6.4.0-darwin-x64.node +0 -0
  51. package/build/Release/oracledb-6.4.0-darwin-x64.node-buildinfo.txt +0 -1
  52. package/build/Release/oracledb-6.4.0-js-buildinfo.txt +0 -1
  53. package/build/Release/oracledb-6.4.0-linux-arm64.node +0 -0
  54. package/build/Release/oracledb-6.4.0-linux-arm64.node-buildinfo.txt +0 -1
  55. package/build/Release/oracledb-6.4.0-linux-x64.node +0 -0
  56. package/build/Release/oracledb-6.4.0-linux-x64.node-buildinfo.txt +0 -1
  57. package/build/Release/oracledb-6.4.0-win32-x64.node +0 -0
  58. package/build/Release/oracledb-6.4.0-win32-x64.node-buildinfo.txt +0 -1
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # node-oracledb version 6.4.0
1
+ # node-oracledb version 6.5.0
2
2
 
3
3
  The node-oracledb add-on for Node.js powers high performance Oracle Database
4
4
  applications. Applications can be written in TypeScript, or directly in
5
5
  JavaScript.
6
6
 
7
- Use node-oracledb 6.4.0 to connect Node.js 14.6, or later, to Oracle
7
+ Use node-oracledb 6.5.0 to connect Node.js 14.6, or later, to Oracle
8
8
  Database. Older versions of node-oracledb may work with older versions of
9
9
  Node.js.
10
10
 
@@ -0,0 +1 @@
1
+ oracledb-6.5.0-darwin-x64.node v20.11.1 91a7f419eccbfcd18513c19cd25f55f18a4d8ccc 42edf925eedae73b0d5bd7777167a21987bafc89 Tue, 30 Apr 2024 20:12:57 GMT
@@ -0,0 +1 @@
1
+ 91a7f419eccbfcd18513c19cd25f55f18a4d8ccc
@@ -0,0 +1 @@
1
+ oracledb-6.5.0-linux-arm64.node v18.19.1 91a7f419eccbfcd18513c19cd25f55f18a4d8ccc 42edf925eedae73b0d5bd7777167a21987bafc89 Wed, 01 May 2024 04:29:37 GMT
@@ -0,0 +1 @@
1
+ oracledb-6.5.0-linux-x64.node v16.20.2 91a7f419eccbfcd18513c19cd25f55f18a4d8ccc 42edf925eedae73b0d5bd7777167a21987bafc89 Wed, 01 May 2024 04:22:59 GMT
@@ -0,0 +1 @@
1
+ oracledb-6.5.0-win32-x64.node v18.16.0 91a7f419eccbfcd18513c19cd25f55f18a4d8ccc 42edf925eedae73b0d5bd7777167a21987bafc89 Wed, 01 May 2024 04:34:23 GMT
package/lib/aqQueue.js CHANGED
@@ -181,7 +181,7 @@ class AqQueue {
181
181
  async deqOne() {
182
182
  errors.assertArgCount(arguments, 0, 0);
183
183
  const msgImpls = await this._impl.deq(1);
184
- if (msgImpls)
184
+ if (msgImpls.length > 0)
185
185
  return this._makeMessage(msgImpls[0]);
186
186
  }
187
187
 
package/lib/connection.js CHANGED
@@ -200,12 +200,13 @@ class Connection extends EventEmitter {
200
200
  typeof value === 'number' ||
201
201
  typeof value === 'string' ||
202
202
  typeof value === 'boolean' ||
203
+ typeof value === 'bigint' ||
203
204
  Array.isArray(value) ||
204
205
  value instanceof Float32Array ||
205
206
  value instanceof Float64Array ||
206
207
  value instanceof Int8Array ||
207
208
  Buffer.isBuffer(value) ||
208
- util.isDate(value) ||
209
+ util.types.isDate(value) ||
209
210
  value instanceof Lob ||
210
211
  value instanceof ResultSet ||
211
212
  value instanceof BaseDbObject
@@ -570,11 +571,8 @@ class Connection extends EventEmitter {
570
571
  } else {
571
572
 
572
573
  // fetchArraySize must be a positive integer
573
- if (options.fetchArraySize !== undefined) {
574
- errors.assertParamPropValue(Number.isInteger(options.fetchArraySize) &&
575
- options.fetchArraySize > 0, 3, "fetchArraySize");
576
- outOptions.fetchArraySize = options.fetchArraySize;
577
- }
574
+ errors.assertParamPropUnsignedIntNonZero(options, 3, "fetchArraySize");
575
+ outOptions.fetchArraySize = options.fetchArraySize;
578
576
 
579
577
  // fetchInfo must be an object with keys containing an object with a
580
578
  // "type" property; these are converted to an array of objects for ease
@@ -860,7 +858,7 @@ class Connection extends EventEmitter {
860
858
  //---------------------------------------------------------------------------
861
859
  encodeOSON(value) {
862
860
  const encoder = new oson.OsonEncoder();
863
- return encoder.encode(transformer.transformJsonValue(value));
861
+ return encoder.encode(transformer.transformJsonValue(value), this._impl._osonMaxFieldNameSize);
864
862
  }
865
863
 
866
864
  //---------------------------------------------------------------------------
@@ -927,8 +925,8 @@ class Connection extends EventEmitter {
927
925
 
928
926
  // process output binds
929
927
  if (result.outBinds !== undefined) {
930
- for (const key in result.outBinds) {
931
- const val = this._transformOutBind(result.outBinds[key], options);
928
+ for (const [key, value] of Object.entries(result.outBinds)) {
929
+ const val = this._transformOutBind(value, options);
932
930
  result.outBinds[key] = val;
933
931
  }
934
932
  }
@@ -937,10 +935,9 @@ class Connection extends EventEmitter {
937
935
  // array size fixed, or, if a result set is not requested, that all rows
938
936
  // are fetched
939
937
  if (result.implicitResults) {
940
- for (const key in result.implicitResults) {
941
- const resultSetImpl = result.implicitResults[key];
938
+ for (const [key, impl] of Object.entries(result.implicitResults)) {
942
939
  const resultSet = new ResultSet();
943
- resultSet._setup(this, resultSetImpl);
940
+ resultSet._setup(this, impl);
944
941
  if (options.resultSet) {
945
942
  result.implicitResults[key] = resultSet;
946
943
  } else {
@@ -996,8 +993,8 @@ class Connection extends EventEmitter {
996
993
  if (result.outBinds !== undefined) {
997
994
  for (let i = 0; i < result.outBinds.length; i++) {
998
995
  const outBind = result.outBinds[i];
999
- for (const key in outBind) {
1000
- outBind[key] = this._transformOutBind(outBind[key], options);
996
+ for (const [key, value] of Object.entries(outBind)) {
997
+ outBind[key] = this._transformOutBind(value, options);
1001
998
  }
1002
999
  }
1003
1000
  }
package/lib/errors.js CHANGED
@@ -143,6 +143,8 @@ const ERR_WRONG_LENGTH_FOR_DBOBJECT_ELEM = 143;
143
143
  const ERR_VECTOR_FORMAT_NOT_SUPPORTED = 144;
144
144
  const ERR_VECTOR_VERSION_NOT_SUPPORTED = 145;
145
145
  const ERR_OBJECT_IS_NOT_A_COLLECTION = 146;
146
+ const ERR_CURSOR_HAS_BEEN_CLOSED = 147;
147
+ const ERR_DML_RETURNING_DUP_BINDS = 149;
146
148
 
147
149
  // Oracle Net layer errors start from 500
148
150
  const ERR_CONNECTION_CLOSED = 500;
@@ -356,7 +358,7 @@ messages.set(ERR_INTEGER_TOO_LARGE, // NJS-112
356
358
  messages.set(ERR_UNEXPECTED_DATA, // NJS-113
357
359
  'unexpected data received: %s');
358
360
  messages.set(ERR_OSON_FIELD_NAME_LIMITATION, // NJS-114
359
- 'OSON field names may not exceed 255 UTF-8 encoded bytes');
361
+ 'OSON field names may not exceed %d UTF-8 encoded bytes');
360
362
  messages.set(ERR_ORACLE_NUMBER_NO_REPR, // NJS-115
361
363
  'value cannot be represented as an Oracle Database number');
362
364
  messages.set(ERR_UNSUPPORTED_VERIFIER_TYPE, // NJS-116
@@ -417,6 +419,10 @@ messages.set(ERR_VECTOR_VERSION_NOT_SUPPORTED, // NJS-145
417
419
  'VECTOR version %d is not supported');
418
420
  messages.set(ERR_OBJECT_IS_NOT_A_COLLECTION, // NJS-146
419
421
  'object %s is not a collection');
422
+ messages.set(ERR_CURSOR_HAS_BEEN_CLOSED, // NJS-147
423
+ 'cursor has been closed by the database');
424
+ messages.set(ERR_DML_RETURNING_DUP_BINDS, // NJS-149
425
+ 'the bind variable placeholder "%s" cannot be used both before and after the RETURNING clause in a DML RETURNING statement');
420
426
 
421
427
  // Oracle Net layer errors
422
428
 
@@ -543,6 +549,19 @@ function assertParamPropUnsignedInt(obj, parameterNum, propName) {
543
549
  }
544
550
  }
545
551
 
552
+ //-----------------------------------------------------------------------------
553
+ // assertParamPropUnsignedIntNonZero()
554
+ //
555
+ // Asserts that the property value of a parameter is a positive integer value
556
+ // (or undefined).
557
+ //-----------------------------------------------------------------------------
558
+ function assertParamPropUnsignedIntNonZero(obj, parameterNum, propName) {
559
+ if (obj[propName] !== undefined) {
560
+ assertParamPropValue(Number.isInteger(obj[propName]) && obj[propName] > 0,
561
+ parameterNum, propName);
562
+ }
563
+ }
564
+
546
565
  //-----------------------------------------------------------------------------
547
566
  // assertParamPropString()
548
567
  //
@@ -639,7 +658,7 @@ function transformErr(err, fnOpt) {
639
658
  err.code = err.message.substr(0, pos);
640
659
  /* add Oracle Database Error Help Portal URL for database error
641
660
  messages, but only in thin mode since this is done
642
- automatically in thick mode with Oracle Client 23c and higher
661
+ automatically in thick mode with Oracle Client 23ai and higher
643
662
  */
644
663
  const settings = require('./settings.js');
645
664
  if (err.errorNum && settings.thin) {
@@ -808,6 +827,8 @@ module.exports = {
808
827
  ERR_VECTOR_FORMAT_NOT_SUPPORTED,
809
828
  ERR_VECTOR_VERSION_NOT_SUPPORTED,
810
829
  ERR_OBJECT_IS_NOT_A_COLLECTION,
830
+ ERR_CURSOR_HAS_BEEN_CLOSED,
831
+ ERR_DML_RETURNING_DUP_BINDS,
811
832
  ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
812
833
  WRN_COMPILATION_CREATE,
813
834
  assert,
@@ -817,6 +838,7 @@ module.exports = {
817
838
  assertParamPropInt,
818
839
  assertParamPropString,
819
840
  assertParamPropUnsignedInt,
841
+ assertParamPropUnsignedIntNonZero,
820
842
  assertParamPropValue,
821
843
  assertParamValue,
822
844
  assertPropValue,
@@ -37,6 +37,7 @@ class ConnectionImpl {
37
37
  this._inProgress = false;
38
38
  this._dbObjectTypes = new Map();
39
39
  this._requestQueue = [];
40
+ this._osonMaxFieldNameSize = 255;
40
41
  }
41
42
 
42
43
  //---------------------------------------------------------------------------
@@ -110,7 +111,7 @@ class ConnectionImpl {
110
111
  // removed once Node-API version 5 is used in the C extension.
111
112
  // ---------------------------------------------------------------------------
112
113
  _isDate(val) {
113
- return (util.isDate(val));
114
+ return (util.types.isDate(val));
114
115
  }
115
116
 
116
117
  //---------------------------------------------------------------------------
@@ -35,16 +35,15 @@ module.exports = {
35
35
  TNS_VECTOR_VERSION: 0,
36
36
 
37
37
  // vector flags
38
- TNS_VECTOR_FLAG_DIM_UINT8: 0x0001,
39
- TNS_VECTOR_FLAG_DIM_UINT32: 0x0002,
40
- TNS_VECTOR_FLAG_NORMSRC: 0x0040,
41
- TNS_VECTOR_FLAG_NORM: 0x0008,
38
+ TNS_VECTOR_FLAG_NORMSRC: 0x0010,
39
+ TNS_VECTOR_FLAG_NORM: 0x0002,
42
40
 
43
41
  // base JSON constants
44
42
  TNS_JSON_MAGIC_BYTE_1: 0xff,
45
43
  TNS_JSON_MAGIC_BYTE_2: 0x4a, // 'J'
46
44
  TNS_JSON_MAGIC_BYTE_3: 0x5a, // 'Z'
47
- TNS_JSON_VERSION: 1,
45
+ TNS_JSON_VERSION_MAX_FNAME_255: 1,
46
+ TNS_JSON_VERSION_MAX_FNAME_65535: 3,
48
47
  TNS_JSON_FLAG_HASH_ID_UINT8: 0x0100,
49
48
  TNS_JSON_FLAG_HASH_ID_UINT16: 0x0200,
50
49
  TNS_JSON_FLAG_NUM_FNAMES_UINT16: 0x0400,
@@ -56,6 +55,7 @@ module.exports = {
56
55
  TNS_JSON_FLAG_LEN_IN_PCODE: 0x04,
57
56
  TNS_JSON_FLAG_NUM_FNAMES_UINT32: 0x08,
58
57
  TNS_JSON_FLAG_IS_SCALAR: 0x10,
58
+ TNS_JSON_FLAG_SEC_FNAMES_SEG_UINT16: 0x100,
59
59
 
60
60
  // JSON data types
61
61
  TNS_JSON_TYPE_NULL: 0x30,
@@ -79,6 +79,7 @@ module.exports = {
79
79
  TNS_JSON_TYPE_ARRAY: 0xc0,
80
80
  TNS_JSON_TYPE_EXTENDED: 0x7b,
81
81
  TNS_JSON_TYPE_VECTOR: 0x01,
82
+ TNS_JSON_TYPE_ID: 0x7e,
82
83
 
83
84
  // timezone offsets
84
85
  TZ_HOUR_OFFSET: 20,