oracledb 6.5.1 → 6.6.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/README.md +2 -2
  2. package/build/Release/oracledb-6.6.0-darwin-arm64.node +0 -0
  3. package/build/Release/oracledb-6.6.0-darwin-arm64.node-buildinfo.txt +1 -0
  4. package/build/Release/oracledb-6.6.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-6.6.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-6.6.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-6.6.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-6.6.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.6.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-6.6.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.6.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-6.6.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/examples/README.md +2 -0
  14. package/lib/configProviders/azure.js +167 -0
  15. package/lib/configProviders/base.js +99 -0
  16. package/lib/configProviders/ociobject.js +203 -0
  17. package/lib/connection.js +28 -12
  18. package/lib/constants.js +1 -0
  19. package/lib/errors.js +56 -1
  20. package/lib/impl/datahandlers/constants.js +3 -1
  21. package/lib/impl/datahandlers/vector.js +24 -9
  22. package/lib/impl/lob.js +27 -0
  23. package/lib/impl/resultset.js +26 -1
  24. package/lib/lob.js +52 -1
  25. package/lib/oracledb.js +54 -0
  26. package/lib/thin/connection.js +232 -16
  27. package/lib/thin/dbObject.js +4 -0
  28. package/lib/thin/lob.js +193 -1
  29. package/lib/thin/pool.js +15 -0
  30. package/lib/thin/protocol/capabilities.js +2 -0
  31. package/lib/thin/protocol/constants.js +29 -1
  32. package/lib/thin/protocol/messages/index.js +5 -1
  33. package/lib/thin/protocol/messages/lobOp.js +17 -5
  34. package/lib/thin/protocol/messages/transactionChangeState.js +99 -0
  35. package/lib/thin/protocol/messages/transactionSwitch.js +139 -0
  36. package/lib/thin/protocol/messages/withData.js +26 -6
  37. package/lib/thin/sqlnet/networkSession.js +2 -1
  38. package/lib/thin/sqlnet/paramParser.js +87 -50
  39. package/lib/thin/sqlnet/sessionAtts.js +13 -1
  40. package/lib/transformer.js +1 -2
  41. package/lib/types.js +1 -1
  42. package/lib/util.js +34 -2
  43. package/lib/version.js +2 -2
  44. package/package.json +1 -1
  45. package/build/Release/oracledb-6.5.1-darwin-x64.node +0 -0
  46. package/build/Release/oracledb-6.5.1-darwin-x64.node-buildinfo.txt +0 -1
  47. package/build/Release/oracledb-6.5.1-js-buildinfo.txt +0 -1
  48. package/build/Release/oracledb-6.5.1-linux-arm64.node +0 -0
  49. package/build/Release/oracledb-6.5.1-linux-arm64.node-buildinfo.txt +0 -1
  50. package/build/Release/oracledb-6.5.1-linux-x64.node +0 -0
  51. package/build/Release/oracledb-6.5.1-linux-x64.node-buildinfo.txt +0 -1
  52. package/build/Release/oracledb-6.5.1-win32-x64.node +0 -0
  53. package/build/Release/oracledb-6.5.1-win32-x64.node-buildinfo.txt +0 -1
@@ -77,6 +77,9 @@ class SessionAtts {
77
77
  if (typeof params.walletPassword === 'string') {
78
78
  this.nt.walletPassword = params.walletPassword;
79
79
  }
80
+ if (typeof params.walletContent === 'string') {
81
+ this.nt.wallet = params.walletContent;
82
+ }
80
83
  if (params.expireTime > 0) {
81
84
  this.nt.expireTime = params.expireTime * 1000 * 60;
82
85
  }
@@ -135,6 +138,15 @@ class SessionAtts {
135
138
  });
136
139
  }
137
140
 
141
+ /**
142
+ * Clear wallet
143
+ */
144
+ clearWallet() {
145
+ if (this.nt.wallet && Buffer.isBuffer(this.nt.wallet))
146
+ this.nt.wallet.fill(0);
147
+ this.nt.wallet = null;
148
+ }
149
+
138
150
  /**
139
151
  * Prepare attributes for connection, Generate Connection ID and read Wallet file
140
152
  *
@@ -151,7 +163,7 @@ class SessionAtts {
151
163
  }
152
164
  this.nt.connectionId = this.connectionId;
153
165
 
154
- if (protocol && (protocol.toUpperCase() == "TCPS" && this.nt.walletFile)) {
166
+ if (protocol && (protocol.toUpperCase() == "TCPS" && !this.nt.wallet && this.nt.walletFile)) {
155
167
  this.nt.wallet = await this.readWalletFile();
156
168
  }
157
169
 
@@ -228,8 +228,7 @@ function transformValueIn(info, value, options) {
228
228
  return value._impl;
229
229
 
230
230
  // handle vectors
231
- } else if (value instanceof Float32Array || value instanceof Float64Array ||
232
- value instanceof Int8Array) {
231
+ } else if (nodbUtil.isVectorValue(value)) {
233
232
  checkType(info, options, types.DB_TYPE_VECTOR);
234
233
  return value;
235
234
  } else if (info.type === types.DB_TYPE_VECTOR && Array.isArray(value)) {
package/lib/types.js CHANGED
@@ -112,7 +112,7 @@ function getTypeByOraTypeNum(oraTypeNum, csfrm) {
112
112
 
113
113
  const DB_TYPE_BFILE = new DbType(2020,
114
114
  "DB_TYPE_BFILE", "BFILE",
115
- { oraTypeNum: 114, bufferSizeFactor: 112 });
115
+ { oraTypeNum: 114, bufferSizeFactor: 4000 });
116
116
  const DB_TYPE_BINARY_DOUBLE = new DbType(2008,
117
117
  "DB_TYPE_BINARY_DOUBLE", "BINARY_DOUBLE",
118
118
  { oraTypeNum: 101, bufferSizeFactor: 8 });
package/lib/util.js CHANGED
@@ -277,6 +277,36 @@ function isXid(value) {
277
277
  typeof value.branchQualifier === 'string'));
278
278
  }
279
279
 
280
+ function normalizeXid(value) {
281
+ let normalizedXid;
282
+ if (Buffer.isBuffer(value.globalTransactionId) &&
283
+ Buffer.isBuffer(value.branchQualifier)) {
284
+ normalizedXid = value;
285
+ } else {
286
+ normalizedXid = {
287
+ formatId: value.formatId,
288
+ globalTransactionId: value.globalTransactionId,
289
+ branchQualifier: value.branchQualifier
290
+ };
291
+ if (typeof value.globalTransactionId === 'string') {
292
+ normalizedXid.globalTransactionId = Buffer.from(value.globalTransactionId);
293
+ }
294
+ if (typeof value.branchQualifier === 'string') {
295
+ normalizedXid.branchQualifier = Buffer.from(value.branchQualifier);
296
+ }
297
+ }
298
+ if (normalizedXid.globalTransactionId.length > 64) {
299
+ errors.throwErr(errors.ERR_INVALID_TRANSACTION_SIZE,
300
+ normalizedXid.globalTransactionId.length);
301
+ }
302
+ if (normalizedXid.branchQualifier.length > 64) {
303
+ errors.throwErr(errors.ERR_INVALID_BRANCH_SIZE,
304
+ normalizedXid.branchQualifier.length);
305
+ }
306
+
307
+ return normalizedXid;
308
+ }
309
+
280
310
  function verifySodaDoc(content) {
281
311
  if (isSodaDocument(content))
282
312
  return content._impl;
@@ -362,8 +392,9 @@ function addTypeProperties(obj, attrName) {
362
392
  // -----------------------------------------------------------------------------
363
393
  function isVectorValue(value) {
364
394
  return (value instanceof Float32Array ||
365
- value instanceof Float64Array ||
366
- value instanceof Int8Array);
395
+ value instanceof Float64Array ||
396
+ value instanceof Int8Array || (Object.getPrototypeOf(value)
397
+ === Uint8Array.prototype));
367
398
  }
368
399
 
369
400
  //-----------------------------------------------------------------------------
@@ -403,6 +434,7 @@ module.exports = {
403
434
  isTokenValid,
404
435
  isVectorValue,
405
436
  isXid,
437
+ normalizeXid,
406
438
  makeDate,
407
439
  preventConcurrent,
408
440
  serialize,
package/lib/version.js CHANGED
@@ -30,7 +30,7 @@
30
30
 
31
31
  module.exports = {
32
32
  VERSION_MAJOR: 6,
33
- VERSION_MINOR: 5,
34
- VERSION_PATCH: 1,
33
+ VERSION_MINOR: 6,
34
+ VERSION_PATCH: 0,
35
35
  VERSION_SUFFIX: ''
36
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "6.5.1",
3
+ "version": "6.6.0",
4
4
  "description": "A Node.js module for Oracle Database access from JavaScript and TypeScript",
5
5
  "license": "(Apache-2.0 OR UPL-1.0)",
6
6
  "homepage": "http://oracle.github.io/node-oracledb/",
@@ -1 +0,0 @@
1
- oracledb-6.5.1-darwin-x64.node v20.11.1 572ce8bae4965b47d3554fa08a0d131acb4dc70b 077b92ae23b597c7854563e2ab4506966aa5fe40 Fri, 17 May 2024 14:57:54 GMT
@@ -1 +0,0 @@
1
- 572ce8bae4965b47d3554fa08a0d131acb4dc70b
@@ -1 +0,0 @@
1
- oracledb-6.5.1-linux-arm64.node v18.19.1 572ce8bae4965b47d3554fa08a0d131acb4dc70b 077b92ae23b597c7854563e2ab4506966aa5fe40 Fri, 17 May 2024 15:07:07 GMT
@@ -1 +0,0 @@
1
- oracledb-6.5.1-linux-x64.node v16.20.2 572ce8bae4965b47d3554fa08a0d131acb4dc70b 077b92ae23b597c7854563e2ab4506966aa5fe40 Fri, 17 May 2024 15:08:37 GMT
@@ -1 +0,0 @@
1
- oracledb-6.5.1-win32-x64.node v18.16.0 572ce8bae4965b47d3554fa08a0d131acb4dc70b 077b92ae23b597c7854563e2ab4506966aa5fe40 Fri, 17 May 2024 15:09:11 GMT