oracledb 6.10.0 → 7.0.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 (84) hide show
  1. package/LICENSE.txt +1 -1
  2. package/NOTICE.txt +1 -1
  3. package/README.md +9 -9
  4. package/build/Release/oracledb-7.0.0-darwin-arm64.node +0 -0
  5. package/build/Release/oracledb-7.0.0-darwin-arm64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-7.0.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-7.0.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-7.0.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-7.0.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-7.0.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-7.0.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-7.0.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/eslint.config.js +39 -0
  14. package/lib/connection.js +412 -37
  15. package/lib/endUserSecurityContext.js +176 -0
  16. package/lib/errors.js +86 -5
  17. package/lib/impl/connection.js +76 -2
  18. package/lib/impl/datahandlers/buffer.js +19 -5
  19. package/lib/impl/datahandlers/vector.js +25 -5
  20. package/lib/impl/lob.js +9 -0
  21. package/lib/impl/parserHelpers.js +443 -0
  22. package/lib/impl/resultset.js +1 -1
  23. package/lib/lob.js +27 -14
  24. package/lib/obfuscation.js +97 -0
  25. package/lib/oracledb.js +148 -43
  26. package/lib/parser.js +204 -0
  27. package/lib/pipeline.js +113 -0
  28. package/lib/pool.js +16 -1
  29. package/lib/resultset.js +42 -21
  30. package/lib/settings.js +1 -0
  31. package/lib/thin/connection.js +467 -53
  32. package/lib/thin/dbObject.js +7 -1
  33. package/lib/thin/lob.js +20 -1
  34. package/lib/thin/pool.js +42 -62
  35. package/lib/thin/protocol/capabilities.js +18 -3
  36. package/lib/thin/protocol/constants.js +82 -2
  37. package/lib/thin/protocol/encryptDecrypt.js +43 -8
  38. package/lib/thin/protocol/messages/auth.js +6 -1
  39. package/lib/thin/protocol/messages/base.js +245 -4
  40. package/lib/thin/protocol/messages/dataType.js +8 -3
  41. package/lib/thin/protocol/messages/directPathLoadStream.js +377 -0
  42. package/lib/thin/protocol/messages/directPathOp.js +65 -0
  43. package/lib/thin/protocol/messages/directPathPrepare.js +158 -0
  44. package/lib/thin/protocol/messages/endPipeline.js +56 -0
  45. package/lib/thin/protocol/messages/execute.js +9 -7
  46. package/lib/thin/protocol/messages/index.js +9 -1
  47. package/lib/thin/protocol/messages/protocol.js +2 -2
  48. package/lib/thin/protocol/messages/withData.js +8 -140
  49. package/lib/thin/protocol/packet.js +115 -24
  50. package/lib/thin/protocol/protocol.js +110 -25
  51. package/lib/thin/protocol/utils.js +1 -26
  52. package/lib/thin/resultSet.js +13 -19
  53. package/lib/thin/sqlnet/ezConnectResolver.js +2 -2
  54. package/lib/thin/sqlnet/networkSession.js +62 -40
  55. package/lib/thin/sqlnet/ntTcp.js +24 -0
  56. package/lib/thin/sqlnet/nvStrToNvPair.js +50 -25
  57. package/lib/thin/sqlnet/packet.js +25 -4
  58. package/lib/thin/sqlnet/paramParser.js +10 -7
  59. package/lib/thin/statementCache.js +2 -4
  60. package/lib/traceHandler.js +59 -2
  61. package/lib/transformer.js +8 -3
  62. package/lib/types.js +35 -21
  63. package/lib/util.js +6 -6
  64. package/lib/version.js +3 -3
  65. package/package/install.js +5 -5
  66. package/package/prunebinaries.js +1 -1
  67. package/package.json +1 -1
  68. package/plugins/configProviders/awsCommon.js +125 -0
  69. package/plugins/configProviders/awss3/index.js +138 -0
  70. package/plugins/configProviders/awssecretsmanager/index.js +147 -0
  71. package/plugins/configProviders/azure/index.js +4 -5
  72. package/plugins/token/extensionAzure/index.js +0 -1
  73. package/plugins/token/extensionOci/index.js +0 -1
  74. package/build/Release/oracledb-6.10.0-darwin-arm64.node +0 -0
  75. package/build/Release/oracledb-6.10.0-darwin-arm64.node-buildinfo.txt +0 -1
  76. package/build/Release/oracledb-6.10.0-darwin-x64.node +0 -0
  77. package/build/Release/oracledb-6.10.0-darwin-x64.node-buildinfo.txt +0 -1
  78. package/build/Release/oracledb-6.10.0-js-buildinfo.txt +0 -1
  79. package/build/Release/oracledb-6.10.0-linux-arm64.node +0 -0
  80. package/build/Release/oracledb-6.10.0-linux-arm64.node-buildinfo.txt +0 -1
  81. package/build/Release/oracledb-6.10.0-linux-x64.node +0 -0
  82. package/build/Release/oracledb-6.10.0-linux-x64.node-buildinfo.txt +0 -1
  83. package/build/Release/oracledb-6.10.0-win32-x64.node +0 -0
  84. package/build/Release/oracledb-6.10.0-win32-x64.node-buildinfo.txt +0 -1
@@ -27,17 +27,20 @@
27
27
  'use strict';
28
28
 
29
29
  /**
30
- * TraceHandler interface defination which application needs to implement
30
+ * TraceHandler interface definition which application needs to implement
31
31
  * the hooks defined. The hooks will be called by the driver with traceContext
32
32
  * data.
33
33
  *
34
34
  * TraceContext Data details.
35
35
  * connectLevelConfig - Connection Config details.
36
- * protcol - tcp/tcps protocol.
36
+ * protocol - tcp/tcps protocol.
37
37
  * user - user/schema associated.
38
+ * dbName - Database Name.
38
39
  * instanceName - instance Name.
39
40
  * pdbName - PDB name.
41
+ * domainName - Domain name.
40
42
  * serviceName - service name.
43
+ * dbUniqueName - Database unique name.
41
44
  * connectString - connect string passed.
42
45
  * hostName - host name.
43
46
  * port - port number.
@@ -100,6 +103,60 @@ class TraceHandlerBase {
100
103
  onEndRoundTrip(/*traceContext*/) {
101
104
  }
102
105
 
106
+ /**
107
+ * Called when the pool expands by creating new connections.
108
+ * Useful for tracking pool growth or initialization activity.
109
+ */
110
+ onPoolExpand(/*pool*/) {}
111
+
112
+ /**
113
+ * Called when the pool shrinks and a connection is removed,
114
+ * such as during timeouts or pool resizing. Useful for
115
+ * monitoring resource cleanup or shrink events.
116
+ */
117
+ onPoolShrink(/*pool*/) {}
118
+
119
+ /**
120
+ * Called when a connection is successfully acquired from the pool.
121
+ * Useful for tracking active usage or checkout activity.
122
+ */
123
+ onPoolAcquire(/*pool*/) {}
124
+
125
+ /**
126
+ * Called when a connection is released back to the pool.
127
+ * Useful for monitoring returned or idle connections.
128
+ */
129
+ onPoolRelease(/*pool*/) {}
130
+
131
+ /**
132
+ * Called when a connection request is queued because the pool
133
+ * cannot grow further. Useful for monitoring queued requests.
134
+ */
135
+ onPoolWait(/*pool*/) {}
136
+
137
+ /**
138
+ * Called when a queued connection request times out before it
139
+ * can be served. Useful for tracking request timeouts or failures.
140
+ */
141
+ onPoolRequestTimeout(/*pool*/) {}
142
+
143
+ /**
144
+ * Called when a requested connection is obtained from the pool's
145
+ * free list (cache hit). Useful for analyzing connection reuse.
146
+ */
147
+ onPoolConnectionHit(/*pool*/) {}
148
+
149
+ /**
150
+ * Called when a connection request requires creating a new
151
+ * connection (cache miss). Useful for monitoring connection creation.
152
+ */
153
+ onPoolConnectionMiss(/*pool*/) {}
154
+
155
+ /**
156
+ * Called when the pool is closed. Useful for tracking shutdown
157
+ * events or resetting counters.
158
+ */
159
+ onPoolClose(/*pool*/) {}
103
160
  }
104
161
 
105
162
  // singleton object pointing to traceHandler instance.
@@ -158,9 +158,13 @@ function transformValueIn(info, value, options) {
158
158
  types.DB_TYPE_CHAR,
159
159
  types.DB_TYPE_NCHAR,
160
160
  types.DB_TYPE_CLOB,
161
- types.DB_TYPE_NCLOB);
161
+ types.DB_TYPE_NCLOB,
162
+ types.DB_TYPE_LONG,
163
+ types.DB_TYPE_LONG_NVARCHAR);
162
164
  if (info.type !== types.DB_TYPE_CLOB &&
163
- info.type !== types.DB_TYPE_NCLOB) {
165
+ info.type !== types.DB_TYPE_NCLOB &&
166
+ info.type !== types.DB_TYPE_LONG &&
167
+ info.type !== types.DB_TYPE_LONG_NVARCHAR) {
164
168
  const valueLen = Buffer.byteLength(value);
165
169
  if (info.maxSize === undefined || valueLen > info.maxSize) {
166
170
  if (info.checkSize) {
@@ -212,7 +216,8 @@ function transformValueIn(info, value, options) {
212
216
  } else if (Buffer.isBuffer(value)) {
213
217
  checkType(info, options,
214
218
  types.DB_TYPE_RAW,
215
- types.DB_TYPE_BLOB);
219
+ types.DB_TYPE_BLOB,
220
+ types.DB_TYPE_LONG_RAW);
216
221
  if (info.type === types.DB_TYPE_RAW &&
217
222
  (info.maxSize === undefined || value.length > info.maxSize)) {
218
223
  if (info.checkSize) {
package/lib/types.js CHANGED
@@ -45,9 +45,15 @@ class DbType {
45
45
  this._bufferSizeFactor = options.bufferSizeFactor || 0;
46
46
  this._oraTypeNum = options.oraTypeNum || 0;
47
47
  this._csfrm = options.csfrm || 0;
48
+ this._is_fast = options.is_fast || true;
48
49
  dbTypeByNum.set(num, this);
49
50
  const key = this._csfrm * 256 + this._oraTypeNum;
50
51
  dbTypeByOraTypeNum.set(key, this);
52
+ // add a second key for LONG metadata which doesn't always contain the
53
+ // character set form value in metadata received by the database
54
+ if (this._oraTypeNum === 8 && this._csfrm === constants.CSFRM_IMPLICIT) {
55
+ dbTypeByOraTypeNum.set(this._oraTypeNum, this);
56
+ }
51
57
  dbTypeByColumnTypeName.set(columnTypeName, this);
52
58
  }
53
59
 
@@ -113,7 +119,7 @@ function getTypeByOraTypeNum(oraTypeNum, csfrm) {
113
119
 
114
120
  const DB_TYPE_BFILE = new DbType(2020,
115
121
  "DB_TYPE_BFILE", "BFILE",
116
- { oraTypeNum: 114, bufferSizeFactor: 4000 });
122
+ { oraTypeNum: 114, bufferSizeFactor: 4000, is_fast: false });
117
123
  const DB_TYPE_BINARY_DOUBLE = new DbType(2008,
118
124
  "DB_TYPE_BINARY_DOUBLE", "BINARY_DOUBLE",
119
125
  { oraTypeNum: 101, bufferSizeFactor: 8 });
@@ -125,7 +131,7 @@ const DB_TYPE_BINARY_INTEGER = new DbType(2009,
125
131
  { oraTypeNum: 3, bufferSizeFactor: 22 });
126
132
  const DB_TYPE_BLOB = new DbType(2019,
127
133
  "DB_TYPE_BLOB", "BLOB",
128
- { oraTypeNum: 113, bufferSizeFactor: 112 });
134
+ { oraTypeNum: 113, bufferSizeFactor: 112, is_fast: false });
129
135
  const DB_TYPE_BOOLEAN = new DbType(2022,
130
136
  "DB_TYPE_BOOLEAN", "BOOLEAN",
131
137
  { oraTypeNum: 252, bufferSizeFactor: 4 });
@@ -134,10 +140,11 @@ const DB_TYPE_CHAR = new DbType(2003,
134
140
  { oraTypeNum: 96, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 4 });
135
141
  const DB_TYPE_CLOB = new DbType(2017,
136
142
  "DB_TYPE_CLOB", "CLOB",
137
- { oraTypeNum: 112, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 112 });
143
+ { oraTypeNum: 112, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 112,
144
+ is_fast: false });
138
145
  const DB_TYPE_CURSOR = new DbType(2021,
139
146
  "DB_TYPE_CURSOR", "CURSOR",
140
- { oraTypeNum: 102, bufferSizeFactor: 4 });
147
+ { oraTypeNum: 102, bufferSizeFactor: 4, is_fast: false });
141
148
  const DB_TYPE_DATE = new DbType(2011,
142
149
  "DB_TYPE_DATE", "DATE",
143
150
  { oraTypeNum: 12, bufferSizeFactor: 7 });
@@ -149,24 +156,25 @@ const DB_TYPE_INTERVAL_YM = new DbType(2016,
149
156
  { oraTypeNum: 182, bufferSizeFactor: 5 });
150
157
  const DB_TYPE_JSON = new DbType(2027,
151
158
  "DB_TYPE_JSON", "JSON",
152
- { oraTypeNum: 119 });
159
+ { oraTypeNum: 119, is_fast: false });
153
160
  const DB_TYPE_LONG = new DbType(2024,
154
161
  "DB_TYPE_LONG", "LONG",
155
162
  { oraTypeNum: 8, csfrm: constants.CSFRM_IMPLICIT,
156
- bufferSizeFactor: 2 ** 31 - 1 });
163
+ bufferSizeFactor: 2 ** 31 - 1, is_fast: false });
157
164
  const DB_TYPE_LONG_NVARCHAR = new DbType(2031,
158
165
  "DB_TYPE_LONG_NVARCHAR", "LONG",
159
166
  { oraTypeNum: 8, csfrm: constants.CSFRM_NCHAR,
160
- bufferSizeFactor: 2 ** 31 - 1 });
167
+ bufferSizeFactor: 2 ** 31 - 1, is_fast: false });
161
168
  const DB_TYPE_LONG_RAW = new DbType(2025,
162
169
  "DB_TYPE_LONG_RAW", "LONG RAW",
163
- { oraTypeNum: 24, bufferSizeFactor: 2 ** 31 - 1 });
170
+ { oraTypeNum: 24, bufferSizeFactor: 2 ** 31 - 1, is_fast: false });
164
171
  const DB_TYPE_NCHAR = new DbType(2004,
165
172
  "DB_TYPE_NCHAR", "NCHAR",
166
173
  { oraTypeNum: 96, csfrm: constants.CSFRM_NCHAR, bufferSizeFactor: 4 });
167
174
  const DB_TYPE_NCLOB = new DbType(2018,
168
175
  "DB_TYPE_NCLOB", "NCLOB",
169
- { oraTypeNum: 112, csfrm: constants.CSFRM_NCHAR, bufferSizeFactor: 112 });
176
+ { oraTypeNum: 112, csfrm: constants.CSFRM_NCHAR, bufferSizeFactor: 112,
177
+ is_fast: false });
170
178
  const DB_TYPE_NUMBER = new DbType(2010,
171
179
  "DB_TYPE_NUMBER", "NUMBER",
172
180
  { oraTypeNum: 2, bufferSizeFactor: 22 });
@@ -181,7 +189,7 @@ const DB_TYPE_RAW = new DbType(2006,
181
189
  { oraTypeNum: 23, bufferSizeFactor: 1 });
182
190
  const DB_TYPE_ROWID = new DbType(2005,
183
191
  "DB_TYPE_ROWID", "ROWID",
184
- { oraTypeNum: 11, bufferSizeFactor: 18 });
192
+ { oraTypeNum: 11, bufferSizeFactor: 18, is_fast: false });
185
193
  const DB_TYPE_TIMESTAMP = new DbType(2012,
186
194
  "DB_TYPE_TIMESTAMP", "TIMESTAMP",
187
195
  { oraTypeNum: 180, bufferSizeFactor: 11 });
@@ -190,19 +198,20 @@ const DB_TYPE_TIMESTAMP_LTZ = new DbType(2014,
190
198
  { oraTypeNum: 231, bufferSizeFactor: 11 });
191
199
  const DB_TYPE_TIMESTAMP_TZ = new DbType(2013,
192
200
  "DB_TYPE_TIMESTAMP_TZ", "TIMESTAMP WITH TIME ZONE",
193
- { oraTypeNum: 181, bufferSizeFactor: 13 });
201
+ { oraTypeNum: 181, bufferSizeFactor: 13, is_fast: false });
194
202
  const DB_TYPE_UROWID = new DbType(2030,
195
203
  "DB_TYPE_UROWID", "UROWID",
196
- { oraTypeNum: 208 });
204
+ { oraTypeNum: 208, is_fast: false });
197
205
  const DB_TYPE_VARCHAR = new DbType(2001,
198
206
  "DB_TYPE_VARCHAR", "VARCHAR2",
199
207
  { oraTypeNum: 1, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 4 });
200
208
  const DB_TYPE_XMLTYPE = new DbType(2032,
201
209
  "DB_TYPE_XMLTYPE", "XMLTYPE",
202
- { oraTypeNum: 109, csfrm: constants.CSFRM_IMPLICIT, bufferSizeFactor: 2147483647 });
210
+ { oraTypeNum: 109, csfrm: constants.CSFRM_IMPLICIT,
211
+ bufferSizeFactor: 2147483647, is_fast: false });
203
212
  const DB_TYPE_VECTOR = new DbType(2033,
204
213
  "DB_TYPE_VECTOR", "VECTOR",
205
- { oraTypeNum: 127 });
214
+ { oraTypeNum: 127, is_fast: false });
206
215
 
207
216
  // database type conversion map: the top level key refers to the database
208
217
  // type being fetched and the value is another map; this map's key is the
@@ -451,7 +460,7 @@ class SparseVector {
451
460
  try {
452
461
  // use simple tokenizer?
453
462
  data = JSON.parse(str);
454
- } catch (e) {
463
+ } catch {
455
464
  errors.throwErr(errors.ERR_VECTOR_SPARSE_INVALID_JSON);
456
465
  }
457
466
 
@@ -525,8 +534,9 @@ class IntervalYM {
525
534
  errors.assertParamPropInt(obj, 1, "years");
526
535
  errors.assertParamPropInt(obj, 1, "months");
527
536
  }
528
- this.months = obj?.months || 0;
529
- this.years = obj?.years || 0;
537
+ // Normalize the months and years
538
+ this.months = (obj?.months || 0) % 12;
539
+ this.years = (obj?.years || 0) + Math.trunc((obj?.months || 0) / 12);
530
540
  }
531
541
  }
532
542
 
@@ -540,11 +550,15 @@ class IntervalDS {
540
550
  errors.assertParamPropInt(obj, 1, "seconds");
541
551
  errors.assertParamPropInt(obj, 1, "fseconds");
542
552
  }
553
+ // Normalize the time units
543
554
  this.fseconds = obj?.fseconds || 0;
544
- this.seconds = obj?.seconds || 0;
545
- this.minutes = obj?.minutes || 0;
546
- this.hours = obj?.hours || 0;
547
- this.days = obj?.days || 0;
555
+ this.seconds = (obj?.seconds || 0) % 60;
556
+ const totalMinutes = (obj?.minutes || 0) +
557
+ Math.trunc((obj?.seconds || 0) / 60);
558
+ this.minutes = totalMinutes % 60;
559
+ const totalHours = (obj?.hours || 0) + Math.trunc(totalMinutes / 60);
560
+ this.hours = totalHours % 24;
561
+ this.days = (obj?.days || 0) + Math.trunc(totalHours / 24);
548
562
  }
549
563
  }
550
564
 
package/lib/util.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2016, 2025, Oracle and/or its affiliates.
1
+ // Copyright (c) 2016, 2026, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -67,7 +67,7 @@ const validNetworkCharacterSet = new Set(['A', 'B', 'C', 'D', 'E', 'F', 'G',
67
67
  let packageJSON;
68
68
  try {
69
69
  packageJSON = require('../package.json');
70
- } catch (err) {
70
+ } catch {
71
71
  errors.throwErr(errors.ERR_MISSING_FILE, 'package.json');
72
72
  }
73
73
  const PACKAGE_JSON_VERSION = packageJSON.version;
@@ -386,7 +386,7 @@ function isPrivilege(value) {
386
386
  }
387
387
 
388
388
  function isShardingKey(value) {
389
- if (!Array.isArray(value))
389
+ if (!Array.isArray(value) || value.length > 255)
390
390
  return false;
391
391
  for (let i = 0; i < value.length; i++) {
392
392
  const element = value[i];
@@ -473,10 +473,10 @@ function normalizeTransactionId(value) {
473
473
  normalizedTransactionId = crypto.randomUUID();
474
474
  if (typeof normalizedTransactionId === 'string') {
475
475
  normalizedTransactionId = Buffer.from(normalizedTransactionId);
476
- const len = normalizedTransactionId.length;
477
- if ((len === 0) || (len > 64))
478
- errors.throwErr(errors.ERR_INVALID_TRANSACTION_SIZE, len);
479
476
  }
477
+ const len = normalizedTransactionId.length;
478
+ if ((len === 0) || (len > 64))
479
+ errors.throwErr(errors.ERR_INVALID_TRANSACTION_SIZE, len);
480
480
  return normalizedTransactionId;
481
481
  }
482
482
 
package/lib/version.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2023, 2025, Oracle and/or its affiliates.
1
+ // Copyright (c) 2023, 2026, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -29,8 +29,8 @@
29
29
  // Leave the suffix an empty string for production releases.
30
30
 
31
31
  module.exports = {
32
- VERSION_MAJOR: 6,
33
- VERSION_MINOR: 10,
32
+ VERSION_MAJOR: 7,
33
+ VERSION_MINOR: 0,
34
34
  VERSION_PATCH: 0,
35
35
  VERSION_SUFFIX: ''
36
36
  };
@@ -1,4 +1,4 @@
1
- /* Copyright (c) 2017, 2023, Oracle and/or its affiliates. */
1
+ /* Copyright (c) 2017, 2025, Oracle and/or its affiliates. */
2
2
 
3
3
  /******************************************************************************
4
4
  *
@@ -48,21 +48,21 @@ let arch;
48
48
  let thickModeErrMsg;
49
49
 
50
50
  // Log standard output with an 'oracledb' prefix
51
- function log(message) { // eslint-disable-line
51
+ function log() {
52
52
  const args = Array.from(arguments);
53
53
  args.unshift('oracledb');
54
54
  console.log.apply(console, args);
55
55
  }
56
56
 
57
57
  // Log errors. It combines 'oracledb' with a stylized 'ERR' prefix
58
- function error(message) { // eslint-disable-line
58
+ function error() {
59
59
  const args = Array.from(arguments);
60
60
  args.unshift('oracledb \x1b[31mERR!\x1b[0m');
61
61
  console.error.apply(console, args);
62
62
  }
63
63
 
64
64
  // Log warnings. It combines 'oracledb' with a stylized 'WARN' prefix
65
- function warn(message) { // eslint-disable-line
65
+ function warn() {
66
66
  const args = Array.from(arguments);
67
67
  args.unshift('oracledb \x1b[31mWARN!\x1b[0m');
68
68
  console.error.apply(console, args);
@@ -85,7 +85,7 @@ function checkVersion() {
85
85
  function checkThickMode() {
86
86
  try {
87
87
  fs.statSync(nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE);
88
- } catch (err) {
88
+ } catch {
89
89
  errors.throwErr(errors.ERR_NO_BINARY_AVAILABLE, process.platform + ' ' + process.arch);
90
90
  }
91
91
  }
@@ -86,7 +86,7 @@ function removeFileorDir(fileOrDirPath) {
86
86
  // Remove the file or the symlink synchronously
87
87
  fs.unlinkSync(fileOrDirPath);
88
88
  }
89
- } catch (err) {
89
+ } catch {
90
90
  throw new Error('Invalid File or Directory: ' + `'${fileOrDirPath}'`);
91
91
  }
92
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "6.10.0",
3
+ "version": "7.0.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/",
@@ -0,0 +1,125 @@
1
+ // Copyright (c) 2026, Oracle and/or its affiliates.
2
+ //-----------------------------------------------------------------------------
3
+ //
4
+ // This software is dual-licensed to you under the Universal Permissive License
5
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
6
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
7
+ // either license.
8
+ //
9
+ // If you elect to accept the software under the Apache License, Version 2.0,
10
+ // the following applies:
11
+ //
12
+ // Licensed under the Apache License, Version 2.0 (the "License");
13
+ // you may not use this file except in compliance with the License.
14
+ // You may obtain a copy of the License at
15
+ //
16
+ // https://www.apache.org/licenses/LICENSE-2.0
17
+ //
18
+ // Unless required by applicable law or agreed to in writing, software
19
+ // distributed under the License is distributed on an "AS IS" BASIS,
20
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ // See the License for the specific language governing permissions and
22
+ // limitations under the License.
23
+ //
24
+ //-----------------------------------------------------------------------------
25
+
26
+ "use strict";
27
+
28
+
29
+ let fromNodeProviderChain;
30
+ let loadSharedConfigFiles;
31
+ let NodeHttpHandler;
32
+ let HttpsProxyAgent;
33
+
34
+ function initAwsCommon() {
35
+ if (fromNodeProviderChain) {
36
+ return;
37
+ }
38
+
39
+ ({ fromNodeProviderChain } = require("@aws-sdk/credential-providers"));
40
+ ({ loadSharedConfigFiles } = require("@smithy/shared-ini-file-loader"));
41
+ ({ NodeHttpHandler } = require("@smithy/node-http-handler"));
42
+ ({ HttpsProxyAgent } = require("hpagent"));
43
+ }
44
+
45
+ function resolveProxy(paramMap) {
46
+ const proxyHost = paramMap.get("https_proxy") ||
47
+ process.env.HTTPS_PROXY ||
48
+ process.env.https_proxy;
49
+
50
+ const proxyPort = paramMap.get("https_proxy_port") ||
51
+ process.env.HTTPS_PROXY_PORT ||
52
+ process.env.https_proxy_port;
53
+
54
+ if (!proxyHost) {
55
+ return null;
56
+ }
57
+
58
+ const proxy = /^[a-z][a-z0-9+.-]*:\/\//i.test(proxyHost) ?
59
+ proxyHost :
60
+ `http://${proxyHost}`;
61
+
62
+ if (!proxyPort) {
63
+ return proxy;
64
+ }
65
+
66
+ const proxyUrl = new URL(proxy);
67
+ if (!proxyUrl.port) {
68
+ proxyUrl.port = proxyPort;
69
+ }
70
+
71
+ return proxyUrl.toString().replace(/\/$/, "");
72
+ }
73
+
74
+ function initAwsRequestHandler(paramMap) {
75
+ const proxy = resolveProxy(paramMap);
76
+
77
+ if (proxy) {
78
+ const agent = new HttpsProxyAgent({ proxy });
79
+ return new NodeHttpHandler({
80
+ httpAgent: agent,
81
+ httpsAgent: agent,
82
+ });
83
+ }
84
+
85
+ return new NodeHttpHandler();
86
+ }
87
+
88
+ async function resolveRegion(paramMap) {
89
+ if (paramMap.get("aws_region")) return paramMap.get("aws_region");
90
+ if (process.env.AWS_REGION) return process.env.AWS_REGION;
91
+ let region = null;
92
+ try {
93
+ const { configFile, credentialsFile } = await loadSharedConfigFiles();
94
+ const profile = paramMap.get("aws_profile") || process.env.AWS_PROFILE || "default";
95
+ region = configFile[profile]?.region || credentialsFile[profile]?.region;
96
+
97
+ if (!region) {
98
+ throw new Error(`Region not found in AWS config/credentials for profile: ${profile}`);
99
+ }
100
+
101
+ return region;
102
+ } catch (err) {
103
+ throw new Error(
104
+ `AWS Region Resolution Failed: ${err.message}. Ensure AWS_REGION is set or ~/.aws/config is accessible.`
105
+ );
106
+ }
107
+ }
108
+
109
+ function createAwsCredential(paramMap, requestHandler, region) {
110
+ return fromNodeProviderChain({
111
+ profile: paramMap.get("aws_profile") || process.env.AWS_PROFILE || "default",
112
+ clientConfig: {
113
+ requestHandler,
114
+ region
115
+ }
116
+ });
117
+ }
118
+
119
+ module.exports = {
120
+ createAwsCredential,
121
+ initAwsCommon,
122
+ initAwsRequestHandler,
123
+ resolveProxy,
124
+ resolveRegion,
125
+ };
@@ -0,0 +1,138 @@
1
+ // Copyright (c) 2026, Oracle and/or its affiliates.
2
+ //-----------------------------------------------------------------------------
3
+ //
4
+ // This software is dual-licensed to you under the Universal Permissive License
5
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
6
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
7
+ // either license.
8
+ //
9
+ // If you elect to accept the software under the Apache License, Version 2.0,
10
+ // the following applies:
11
+ //
12
+ // Licensed under the Apache License, Version 2.0 (the "License");
13
+ // you may not use this file except in compliance with the License.
14
+ // You may obtain a copy of the License at
15
+ //
16
+ // https://www.apache.org/licenses/LICENSE-2.0
17
+ //
18
+ // Unless required by applicable law or agreed to in writing, software
19
+ // distributed under the License is distributed on an "AS IS" BASIS,
20
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ // See the License for the specific language governing permissions and
22
+ // limitations under the License.
23
+ //
24
+ //-----------------------------------------------------------------------------
25
+
26
+ "use strict";
27
+
28
+ const util = require("node:util");
29
+ const { base } = require("../base.js");
30
+ const {
31
+ createAwsCredential,
32
+ initAwsCommon,
33
+ initAwsRequestHandler,
34
+ resolveRegion
35
+ } = require("../awsCommon.js");
36
+ const oracledb = require("oracledb");
37
+
38
+ let S3Client, GetObjectCommand;
39
+
40
+ class AWSS3Provider extends base {
41
+ constructor(provider_arg, urlExtendedPart) {
42
+ super(urlExtendedPart);
43
+ const url = new URL(provider_arg);
44
+ this._addParam("bucket", url.hostname);
45
+ this._addParam("key", url.pathname.substring(1));
46
+ }
47
+
48
+ init() {
49
+ initAwsCommon();
50
+ ({ S3Client, GetObjectCommand } = require("@aws-sdk/client-s3"));
51
+ this.requestHandler = initAwsRequestHandler(this.paramMap);
52
+ }
53
+
54
+ async dataFromStream(stream) {
55
+ const chunks = [];
56
+ return await new Promise((resolve, reject) => {
57
+ stream.on("data", (chunk) => chunks.push(chunk));
58
+ stream.on("end", () => {
59
+ try {
60
+ const data = Buffer.concat(chunks).toString("utf-8");
61
+ resolve(data);
62
+ } catch (error) {
63
+ reject(new Error(`Rejected with error: ${error.message}`));
64
+ }
65
+ });
66
+ stream.on("error", (error) => {
67
+ reject(new Error(`Stream error: ${error.message}`));
68
+ });
69
+ });
70
+ };
71
+
72
+ async returnConfig() {
73
+ const fetchRegion = await resolveRegion(this.paramMap);
74
+
75
+ this.credential = createAwsCredential(
76
+ this.paramMap,
77
+ this.requestHandler,
78
+ fetchRegion
79
+ );
80
+
81
+ const s3Client = new S3Client({
82
+ region: fetchRegion,
83
+ credentials: this.credential,
84
+ requestHandler: this.requestHandler,
85
+ });
86
+
87
+ const params = {
88
+ Bucket: this.paramMap.get("bucket"),
89
+ Key: this.paramMap.get("key"),
90
+ };
91
+
92
+ try {
93
+ const cmd = new GetObjectCommand(params);
94
+ const resp = await s3Client.send(cmd);
95
+
96
+ if (!resp.Body) {
97
+ throw new Error(`S3 response body is empty for key: ${params.Key}`);
98
+ }
99
+
100
+ const data = await this.dataFromStream(resp.Body);
101
+ return JSON.parse(data);
102
+ } catch (e) {
103
+ const errmsg = util.format(
104
+ "Failed to retrieve or parse config: %s\n%s",
105
+ e.message,
106
+ e.stack
107
+ );
108
+ throw new Error(errmsg);
109
+ } finally {
110
+ s3Client.destroy();
111
+ }
112
+ }
113
+ }
114
+
115
+ module.exports = AWSS3Provider;
116
+
117
+ async function hookFn(args) {
118
+ const configProvider = new AWSS3Provider(
119
+ args.provider_arg,
120
+ args.urlExtendedPart
121
+ );
122
+ try {
123
+ configProvider.init();
124
+ } catch (err) {
125
+ const errmsg = util.format(
126
+ "AWS Config Provider failed to load required modules: %s\n%s",
127
+ err.message,
128
+ err.stack
129
+ );
130
+ throw new Error(errmsg);
131
+ }
132
+
133
+ const cfg = await configProvider.returnConfig();
134
+ // Return config object
135
+ return [cfg, null];
136
+ }
137
+
138
+ oracledb.registerConfigurationProviderHook("awss3", hookFn);