oracledb 6.9.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 (100) 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/aqDeqOptions.js +18 -1
  15. package/lib/aqQueue.js +10 -6
  16. package/lib/connection.js +418 -39
  17. package/lib/dbObject.js +25 -4
  18. package/lib/endUserSecurityContext.js +176 -0
  19. package/lib/errors.js +99 -8
  20. package/lib/impl/aqDeqOptions.js +10 -1
  21. package/lib/impl/connection.js +76 -2
  22. package/lib/impl/datahandlers/buffer.js +68 -5
  23. package/lib/impl/datahandlers/oson.js +7 -2
  24. package/lib/impl/datahandlers/vector.js +25 -5
  25. package/lib/impl/lob.js +9 -0
  26. package/lib/impl/parserHelpers.js +443 -0
  27. package/lib/impl/resultset.js +1 -1
  28. package/lib/impl/sodaDocument.js +5 -14
  29. package/lib/lob.js +27 -14
  30. package/lib/obfuscation.js +97 -0
  31. package/lib/oracledb.js +163 -49
  32. package/lib/parser.js +204 -0
  33. package/lib/pipeline.js +113 -0
  34. package/lib/pool.js +203 -147
  35. package/lib/poolStatistics.js +1 -1
  36. package/lib/resultset.js +42 -21
  37. package/lib/settings.js +1 -0
  38. package/lib/sodaCollection.js +12 -8
  39. package/lib/sodaDatabase.js +35 -8
  40. package/lib/sodaDocument.js +24 -6
  41. package/lib/sodaOperation.js +7 -6
  42. package/lib/thin/aq.js +475 -0
  43. package/lib/thin/connection.js +518 -54
  44. package/lib/thin/dbObject.js +7 -1
  45. package/lib/thin/lob.js +20 -1
  46. package/lib/thin/pool.js +42 -62
  47. package/lib/thin/protocol/capabilities.js +21 -4
  48. package/lib/thin/protocol/constants.js +143 -2
  49. package/lib/thin/protocol/encryptDecrypt.js +45 -10
  50. package/lib/thin/protocol/messages/aqArray.js +238 -0
  51. package/lib/thin/protocol/messages/aqBase.js +305 -0
  52. package/lib/thin/protocol/messages/aqDeq.js +164 -0
  53. package/lib/thin/protocol/messages/aqEnq.js +135 -0
  54. package/lib/thin/protocol/messages/auth.js +18 -28
  55. package/lib/thin/protocol/messages/base.js +245 -4
  56. package/lib/thin/protocol/messages/dataType.js +8 -3
  57. package/lib/thin/protocol/messages/directPathLoadStream.js +377 -0
  58. package/lib/thin/protocol/messages/directPathOp.js +65 -0
  59. package/lib/thin/protocol/messages/directPathPrepare.js +158 -0
  60. package/lib/thin/protocol/messages/endPipeline.js +56 -0
  61. package/lib/thin/protocol/messages/execute.js +9 -7
  62. package/lib/thin/protocol/messages/index.js +9 -1
  63. package/lib/thin/protocol/messages/protocol.js +2 -2
  64. package/lib/thin/protocol/messages/withData.js +10 -142
  65. package/lib/thin/protocol/packet.js +120 -28
  66. package/lib/thin/protocol/protocol.js +110 -25
  67. package/lib/thin/protocol/utils.js +1 -26
  68. package/lib/thin/resultSet.js +13 -19
  69. package/lib/thin/sqlnet/ezConnectResolver.js +2 -2
  70. package/lib/thin/sqlnet/networkSession.js +63 -41
  71. package/lib/thin/sqlnet/ntTcp.js +24 -0
  72. package/lib/thin/sqlnet/nvStrToNvPair.js +50 -25
  73. package/lib/thin/sqlnet/packet.js +25 -4
  74. package/lib/thin/sqlnet/paramParser.js +10 -7
  75. package/lib/thin/statementCache.js +2 -4
  76. package/lib/traceHandler.js +59 -2
  77. package/lib/transformer.js +8 -3
  78. package/lib/types.js +36 -22
  79. package/lib/util.js +6 -19
  80. package/lib/version.js +3 -3
  81. package/package/install.js +5 -5
  82. package/package/prunebinaries.js +1 -1
  83. package/package.json +1 -1
  84. package/plugins/configProviders/awsCommon.js +125 -0
  85. package/plugins/configProviders/awss3/index.js +138 -0
  86. package/plugins/configProviders/awssecretsmanager/index.js +147 -0
  87. package/plugins/configProviders/azure/index.js +7 -5
  88. package/plugins/token/extensionAzure/index.js +0 -1
  89. package/plugins/token/extensionOci/index.js +0 -1
  90. package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
  91. package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +0 -1
  92. package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
  93. package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +0 -1
  94. package/build/Release/oracledb-6.9.0-js-buildinfo.txt +0 -1
  95. package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
  96. package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +0 -1
  97. package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
  98. package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +0 -1
  99. package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
  100. package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +0 -1
package/lib/dbObject.js CHANGED
@@ -79,6 +79,18 @@ function validatePropertyValue(objType, metaData, value, index) {
79
79
  // instantiated; a cache of these classes are maintained on each connection
80
80
  class BaseDbObject {
81
81
 
82
+ //---------------------------------------------------------------------------
83
+ // _ensureCollection()
84
+ //
85
+ // Ensures that the object is a collection.
86
+ //---------------------------------------------------------------------------
87
+ _ensureCollection() {
88
+ if (!this.isCollection) {
89
+ errors.throwErr(errors.ERR_OBJECT_IS_NOT_A_COLLECTION,
90
+ this.name);
91
+ }
92
+ }
93
+
82
94
  //---------------------------------------------------------------------------
83
95
  // _getAttrValue()
84
96
  //
@@ -165,6 +177,7 @@ class BaseDbObject {
165
177
  //---------------------------------------------------------------------------
166
178
  append(value) {
167
179
  errors.assertArgCount(arguments, 1, 1);
180
+ this._ensureCollection();
168
181
  const info = {
169
182
  fqn: this._objType.fqn,
170
183
  type: this._objType.elementType,
@@ -238,6 +251,7 @@ class BaseDbObject {
238
251
  //---------------------------------------------------------------------------
239
252
  deleteElement(index) {
240
253
  errors.assertArgCount(arguments, 1, 1);
254
+ this._ensureCollection();
241
255
  errors.assertParamValue(Number.isInteger(index), 1);
242
256
  return this._impl.deleteElement(index);
243
257
  }
@@ -300,6 +314,7 @@ class BaseDbObject {
300
314
  //---------------------------------------------------------------------------
301
315
  getElement(index) {
302
316
  errors.assertArgCount(arguments, 1, 1);
317
+ this._ensureCollection();
303
318
  errors.assertParamValue(Number.isInteger(index), 1);
304
319
  const value = this._impl.getElement(index);
305
320
  return this._transformValueOut(value, this.elementTypeClass, this._objType.elementTypeInfo);
@@ -312,6 +327,7 @@ class BaseDbObject {
312
327
  //---------------------------------------------------------------------------
313
328
  getKeys() {
314
329
  errors.assertArgCount(arguments, 0, 0);
330
+ this._ensureCollection();
315
331
  return this._impl.getKeys();
316
332
  }
317
333
 
@@ -322,6 +338,7 @@ class BaseDbObject {
322
338
  //---------------------------------------------------------------------------
323
339
  getFirstIndex() {
324
340
  errors.assertArgCount(arguments, 0, 0);
341
+ this._ensureCollection();
325
342
  return this._impl.getFirstIndex();
326
343
  }
327
344
 
@@ -332,6 +349,7 @@ class BaseDbObject {
332
349
  //---------------------------------------------------------------------------
333
350
  getLastIndex() {
334
351
  errors.assertArgCount(arguments, 0, 0);
352
+ this._ensureCollection();
335
353
  return this._impl.getLastIndex();
336
354
  }
337
355
 
@@ -342,6 +360,7 @@ class BaseDbObject {
342
360
  //---------------------------------------------------------------------------
343
361
  getNextIndex(index) {
344
362
  errors.assertArgCount(arguments, 1, 1);
363
+ this._ensureCollection();
345
364
  errors.assertParamValue(Number.isInteger(index), 1);
346
365
  return this._impl.getNextIndex(index);
347
366
  }
@@ -353,6 +372,7 @@ class BaseDbObject {
353
372
  //---------------------------------------------------------------------------
354
373
  getPrevIndex(index) {
355
374
  errors.assertArgCount(arguments, 1, 1);
375
+ this._ensureCollection();
356
376
  errors.assertParamValue(Number.isInteger(index), 1);
357
377
  return this._impl.getPrevIndex(index);
358
378
  }
@@ -364,6 +384,7 @@ class BaseDbObject {
364
384
  //---------------------------------------------------------------------------
365
385
  getValues() {
366
386
  errors.assertArgCount(arguments, 0, 0);
387
+ this._ensureCollection();
367
388
  const values = this._impl.getValues();
368
389
  for (let i = 0; i < values.length; i++) {
369
390
  values[i] = this._transformValueOut(values[i], this.elementTypeClass, this._objType.elementTypeInfo);
@@ -378,6 +399,7 @@ class BaseDbObject {
378
399
  //---------------------------------------------------------------------------
379
400
  hasElement(index) {
380
401
  errors.assertArgCount(arguments, 1, 1);
402
+ this._ensureCollection();
381
403
  errors.assertParamValue(Number.isInteger(index), 1);
382
404
  return this._impl.hasElement(index);
383
405
  }
@@ -426,6 +448,7 @@ class BaseDbObject {
426
448
  //---------------------------------------------------------------------------
427
449
  setElement(index, value) {
428
450
  errors.assertArgCount(arguments, 2, 2);
451
+ this._ensureCollection();
429
452
  errors.assertParamValue(Number.isInteger(index), 1);
430
453
  const info = {
431
454
  fqn: this._objType.fqn,
@@ -445,6 +468,7 @@ class BaseDbObject {
445
468
  //---------------------------------------------------------------------------
446
469
  trim(numToTrim) {
447
470
  errors.assertArgCount(arguments, 1, 1);
471
+ this._ensureCollection();
448
472
  errors.assertParamValue(Number.isInteger(numToTrim) && numToTrim >= 0, 1);
449
473
  this._impl.trim(numToTrim);
450
474
  }
@@ -487,10 +511,7 @@ class BaseDbObject {
487
511
  //---------------------------------------------------------------------------
488
512
  toMap() {
489
513
  errors.assertArgCount(arguments, 0, 0);
490
- if (!this.isCollection) {
491
- errors.throwErr(errors.ERR_OBJECT_IS_NOT_A_COLLECTION,
492
- this.name);
493
- }
514
+ this._ensureCollection();
494
515
  const result = new Map();
495
516
  this.getKeys().forEach(element => {
496
517
  result.set(element, this.getElement(element));
@@ -0,0 +1,176 @@
1
+ // Copyright (c) 2026, Oracle and/or its affiliates.
2
+
3
+ //-----------------------------------------------------------------------------
4
+ //
5
+ // This software is dual-licensed to you under the Universal Permissive License
6
+ // (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
7
+ // 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
8
+ // either license.
9
+ //
10
+ // If you elect to accept the software under the Apache License, Version 2.0,
11
+ // the following applies:
12
+ //
13
+ // Licensed under the Apache License, Version 2.0 (the "License");
14
+ // you may not use this file except in compliance with the License.
15
+ // You may obtain a copy of the License at
16
+ //
17
+ // https://www.apache.org/licenses/LICENSE-2.0
18
+ //
19
+ // Unless required by applicable law or agreed to in writing, software
20
+ // distributed under the License is distributed on an "AS IS" BASIS,
21
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
+ // See the License for the specific language governing permissions and
23
+ // limitations under the License.
24
+ //
25
+ //-----------------------------------------------------------------------------
26
+
27
+ 'use strict';
28
+
29
+ const { Buffer } = require('buffer');
30
+ const errors = require('./errors.js');
31
+ const oson = require('./impl/datahandlers/oson.js');
32
+ const { ObfuscatedValue } = require('./obfuscation.js');
33
+ const transformer = require('./transformer.js');
34
+
35
+ const DEFAULT_MAX_FIELD_NAME_SIZE = 65535;
36
+ const DEFAULT_MAX_PAYLOAD_LENGTH = 65535;
37
+
38
+ function hasNonEmptyText(value) {
39
+ return (typeof value === 'string') && value.trim().length > 0;
40
+ }
41
+
42
+ /*
43
+ Represents the credential set an application associates with an end user.
44
+
45
+ Required properties
46
+ - databaseAccessToken: non-empty string accepted by the database driver.
47
+ - endUserToken or endUserName: at least one must be supplied as a string.
48
+ - key: required whenever endUserName is supplied; otherwise optional.
49
+
50
+ Optional properties
51
+ - key: look-up identifier the database maps to stored context attributes; may be
52
+ omitted only when identifying users via endUserToken.
53
+ - dataRoles: data roles enabled/disabled by the application logic, rather
54
+ than a database security policy.
55
+ - attributes: Attributes are contained in JSON objects conforming
56
+ to a JSON schema of an END USER CONTEXT declared in the database.
57
+
58
+ */
59
+ class EndUserSecurityContext {
60
+ constructor(options) {
61
+ errors.assertArgCount(arguments, 1, 1);
62
+ errors.assertParamValue(
63
+ typeof options === 'object' && options !== null && !Array.isArray(options),
64
+ 1
65
+ );
66
+
67
+ const {
68
+ databaseAccessToken,
69
+ endUserToken,
70
+ endUserName,
71
+ key,
72
+ dataRoles,
73
+ attributes
74
+ } = options;
75
+
76
+ // The database access token is always required, and the end user must be
77
+ // identified either by token or by name.
78
+ errors.assertParamValue(hasNonEmptyText(databaseAccessToken), 1);
79
+ errors.assertParamValue(
80
+ (endUserToken !== undefined && endUserToken !== null) ||
81
+ (endUserName !== undefined && endUserName !== null),
82
+ 1
83
+ );
84
+
85
+ // When supplied, token/name/key values must contain non-whitespace text.
86
+ if (endUserToken !== undefined && endUserToken !== null) {
87
+ errors.assertParamValue(hasNonEmptyText(endUserToken), 1);
88
+ }
89
+
90
+ // Name-based contexts require a key so the database can locate the stored
91
+ // end user context attributes.
92
+ if (endUserName !== undefined && endUserName !== null) {
93
+ errors.assertParamValue(hasNonEmptyText(endUserName), 1);
94
+ errors.assertParamValue(key !== undefined && key !== null, 1);
95
+ }
96
+
97
+ if (key !== undefined && key !== null) {
98
+ errors.assertParamValue(hasNonEmptyText(key), 1);
99
+ }
100
+
101
+ const payload = {
102
+ ver: '1.0',
103
+ database_access_token: databaseAccessToken
104
+ };
105
+
106
+ if (endUserToken != null) {
107
+ payload.end_user_token = endUserToken;
108
+ }
109
+
110
+ if (endUserName != null) {
111
+ payload.end_user_name = endUserName;
112
+ }
113
+
114
+ if (key != null) {
115
+ payload.end_user_contextid = key;
116
+ }
117
+
118
+ // Data roles are optional, but must be passed as an array when present.
119
+ if (dataRoles != null) {
120
+ errors.assertParamValue(Array.isArray(dataRoles), 1);
121
+ payload.data_roles = Array.from(dataRoles);
122
+ }
123
+
124
+ // Attributes are encoded as name/value entries expected by the OSON payload.
125
+ if (attributes != null) {
126
+ errors.assertParamValue(
127
+ typeof attributes === 'object' && !Array.isArray(attributes),
128
+ 1
129
+ );
130
+ payload.attributes = Object.entries(attributes).map(
131
+ ([name, values]) => ({ name, values }));
132
+ }
133
+
134
+ this._payloadStore = new ObfuscatedValue();
135
+ this._encodeAndStorePayload(payload);
136
+ }
137
+
138
+ _encodePayload(value) {
139
+ const encoder = new oson.OsonEncoder();
140
+ return encoder.encode(
141
+ transformer.transformJsonValue(value),
142
+ DEFAULT_MAX_FIELD_NAME_SIZE
143
+ );
144
+ }
145
+
146
+ _encodeAndStorePayload(payload) {
147
+ const encodedPayload =
148
+ this._encodePayload(payload);
149
+ this.setEncodedPayload(encodedPayload);
150
+ }
151
+
152
+ setEncodedPayload(encodedPayload) {
153
+ errors.assertParamValue(Buffer.isBuffer(encodedPayload), 1);
154
+ const payloadLength = encodedPayload.length;
155
+ if (payloadLength > DEFAULT_MAX_PAYLOAD_LENGTH) {
156
+ encodedPayload.fill(0);
157
+ errors.throwErr(
158
+ errors.ERR_INVALID_END_USER_SECURITY_CONTEXT_LENGTH,
159
+ payloadLength
160
+ );
161
+ }
162
+ this.clearEncodedPayload();
163
+ this._payloadStore.set(encodedPayload, { returnBuffer: true });
164
+ encodedPayload.fill(0);
165
+ }
166
+
167
+ getDeobfuscatedValue() {
168
+ return this._payloadStore.get({ returnBuffer: true });
169
+ }
170
+
171
+ clearEncodedPayload() {
172
+ this._payloadStore.clear();
173
+ }
174
+ }
175
+
176
+ module.exports = EndUserSecurityContext;
package/lib/errors.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2026, Oracle and/or its affiliates.
2
2
  //-----------------------------------------------------------------------------
3
3
  //
4
4
  // This software is dual-licensed to you under the Universal Permissive License
@@ -178,6 +178,26 @@ const ERR_CALLOUT_FN = 169;
178
178
  const ERR_SESSIONLESS_DIFFERING_METHODS = 170;
179
179
  const ERR_SESSIONLESS_ALREADY_ACTIVE = 171;
180
180
  const ERR_SESSIONLESS_INACTIVE = 172;
181
+ const ERR_INVALID_SERVER_RESPONSE = 173;
182
+ const ERR_PAYLOAD_CANNOT_BE_ENQUEUED = 174;
183
+ const ERR_NULLS_NOT_ALLOWED = 175;
184
+ const ERR_DPL_TOO_MUCH_DATA = 176;
185
+ const ERR_DPL_INVALID_ROW_DATA = 177;
186
+ const ERR_PIPELINE_OPERATION_NOT_SUPPORTED = 178;
187
+ const ERR_PIPELINE_MISMATCHED_TOKEN = 179;
188
+ const ERR_PIPELINE_DBOBJECTS_NOT_SUPPORTED = 180;
189
+ const ERR_PIPELINE_LARGE_BUFFERS_NOT_SUPPORTED = 181;
190
+ const ERR_PIPELINE_EXEC_OPTION_NOT_SUPPORTED = 182;
191
+ const ERR_INVALID_SQL_NAME = 183;
192
+ const ERR_APP_CONTEXT_EMPTY_NAMESPACE = 184;
193
+ const ERR_APP_CONTEXT_INVALID_KEY_VALUE = 185;
194
+ const ERR_APP_CONTEXT_KEY_TOO_LONG = 186;
195
+ const ERR_APP_CONTEXT_VALUE_TOO_LONG = 187;
196
+ const ERR_UNSUPPORTED_KEY_LENGTH = 188;
197
+ const ERR_INVALID_END_USER_SECURITY_CONTEXT_LENGTH = 189;
198
+ const ERR_END_USER_SECURITY_CONTEXT_REQUIRES_TCPS = 190;
199
+ const ERR_UNSUPPORTED_DEEP_DATA_SECURITY_FEATURE = 191;
200
+ const ERR_CHAR_CS_NOT_SUPPORTED = 192;
181
201
 
182
202
  // Oracle Net layer errors start from 500
183
203
  const ERR_CONNECTION_CLOSED = 500;
@@ -201,6 +221,7 @@ const ERR_INVALID_SERVICE_NAME = 518;
201
221
  const ERR_INVALID_SID = 519;
202
222
  const ERR_TNS_NAMES_FILE_MISSING = 520;
203
223
  const ERR_CONNECTION_EOF = 521;
224
+ const ERR_CONNECT_DESCRIPTOR_LIMIT_EXCEEDED = 522;
204
225
  const ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG = 523;
205
226
  const ERR_REGISTER_HOOKFN_CONFIGPROVIDER = 524;
206
227
  const ERR_WALLET_TYPE_NOT_SUPPORTED = 529;
@@ -210,6 +231,7 @@ const ERR_ANO_STATUS = 532;
210
231
  const ERR_ANO_NEGOTIATION = 533;
211
232
  const ERR_DATA_COMPRESSION = 534;
212
233
  const ERR_CONFIG_PROVIDER_PARAM_TYPE = 535;
234
+ const ERR_TOO_MANY_REDIRECTS = 536;
213
235
 
214
236
  // Oracle SUCCESS_WITH_INFO warning start from 700
215
237
  const WRN_COMPILATION_CREATE = 700;
@@ -254,12 +276,14 @@ adjustErrorXref.set("ORA-12583", ERR_CONNECTION_CLOSED);
254
276
  adjustErrorXref.set("ORA-27146", ERR_CONNECTION_CLOSED);
255
277
  adjustErrorXref.set("ORA-28511", ERR_CONNECTION_CLOSED);
256
278
  adjustErrorXref.set("ORA-56600", ERR_CONNECTION_CLOSED);
279
+ adjustErrorXref.set("ORA-24315", ERR_APP_CONTEXT_EMPTY_NAMESPACE);
257
280
  adjustErrorXref.set("ORA-24338", ERR_INVALID_REF_CURSOR);
258
281
  adjustErrorXref.set("ORA-25708", ERR_TOKEN_HAS_EXPIRED);
259
282
  adjustErrorXref.set("ORA-24344", WRN_COMPILATION_CREATE);
260
283
  adjustErrorXref.set("ORA-26202", ERR_SESSIONLESS_INACTIVE);
261
284
  adjustErrorXref.set("ORA-26211", ERR_SESSIONLESS_DIFFERING_METHODS);
262
285
  adjustErrorXref.set("ORA-26216", ERR_SESSIONLESS_ALREADY_ACTIVE);
286
+ adjustErrorXref.set("DPI-1071", ERR_PAYLOAD_CANNOT_BE_ENQUEUED);
263
287
 
264
288
  // define mapping for error messages
265
289
  const messages = new Map();
@@ -386,7 +410,7 @@ messages.set(ERR_CONN_TOKEN_BASED_AUTH, // NJS-086
386
410
  messages.set(ERR_TOKEN_HAS_EXPIRED, // NJS-087
387
411
  'access token has expired');
388
412
  messages.set(ERR_NOT_IMPLEMENTED, // NJS-089
389
- '%s is not supported by node-oracledb in Thin mode');
413
+ '%s is not supported by node-oracledb in %s mode');
390
414
  messages.set(ERR_INIT_ORACLE_CLIENT_ARGS, // NJS-090
391
415
  'initOracleClient() was already called with different arguments');
392
416
  messages.set(ERR_MISSING_FILE, // NJS-091
@@ -398,9 +422,9 @@ messages.set(ERR_EXEC_MODE_ONLY_FOR_DML, // NJS-095
398
422
  messages.set(ERR_INVALID_BIND_NAME, // NJS-097
399
423
  'no bind placeholder named ":%s" was found in the statement text');
400
424
  messages.set(ERR_WRONG_NUMBER_OF_BINDS, // NJS-098
401
- '%s bind placeholders were used in the SQL statement but %s bind values were provided');
425
+ '%d bind placeholders were used in the SQL statement but %d bind values were provided');
402
426
  messages.set(ERR_BUFFER_LENGTH_INSUFFICIENT, // NJS-099
403
- 'internal error: buffer of length %s insufficient to hold %s bytes');
427
+ 'internal error: buffer of length %d insufficient to hold %d bytes');
404
428
  messages.set(ERR_NCHAR_CS_NOT_SUPPORTED, // NJS-100
405
429
  'national character set id %d is not supported by node-oracledb in Thin mode');
406
430
  messages.set(ERR_MISSING_CREDENTIALS, // NJS-101
@@ -539,6 +563,46 @@ messages.set(ERR_SESSIONLESS_ALREADY_ACTIVE, //NJS-171
539
563
  'Suspend, commit or rollback the currently active sessionless transaction before beginning or resuming another one.');
540
564
  messages.set(ERR_SESSIONLESS_INACTIVE, //NJS-172
541
565
  'No sessionless transaction is active');
566
+ messages.set(ERR_INVALID_SERVER_RESPONSE, //NJS-173
567
+ 'Invalid server response to connection request');
568
+ messages.set(ERR_PAYLOAD_CANNOT_BE_ENQUEUED, // NJS-174
569
+ "Payload cannot be enqueued since it does not match the payload type supported by the queue");
570
+ messages.set(ERR_NULLS_NOT_ALLOWED, // NJS-175
571
+ 'Value for column %s may not be null on row %d');
572
+ messages.set(ERR_DPL_TOO_MUCH_DATA, // NJS-176
573
+ 'The maximum size of a Direct Path load has been exceeded');
574
+ messages.set(ERR_DPL_INVALID_ROW_DATA, // NJS-177
575
+ 'The row data provided for Direct Path load is Invalid. Expected a 2D array (Array of Arrays) representing rows and columns.');
576
+ messages.set(ERR_PIPELINE_OPERATION_NOT_SUPPORTED, // NJS-178
577
+ 'Unsupported pipeline operation type: %s');
578
+ messages.set(ERR_PIPELINE_MISMATCHED_TOKEN, // NJS-179
579
+ 'Pipeline internal error: token number %d does not match expected token number %d');
580
+ messages.set(ERR_PIPELINE_DBOBJECTS_NOT_SUPPORTED, // NJS-180
581
+ 'Oracle Database Object types are not supported in pipeline mode');
582
+ messages.set(ERR_PIPELINE_LARGE_BUFFERS_NOT_SUPPORTED, // NJS-181
583
+ 'PL/SQL blocks with string/bytes object size greater than 32k are not supported in pipeline mode');
584
+ messages.set(ERR_PIPELINE_EXEC_OPTION_NOT_SUPPORTED, // NJS-182
585
+ `Execute option '%s' is not supported in pipeline mode`);
586
+ messages.set(ERR_INVALID_SQL_NAME, // NJS-183
587
+ 'invalid SQL name: embedded double quotes are not allowed');
588
+ messages.set(ERR_APP_CONTEXT_EMPTY_NAMESPACE, // NJS-184
589
+ 'The namespace can not be empty for Application Context');
590
+ messages.set(ERR_APP_CONTEXT_INVALID_KEY_VALUE, // NJS-185
591
+ 'Invalid Application Context entry: both key and value must be strings. Got key=%s, value=%s');
592
+ messages.set(ERR_APP_CONTEXT_KEY_TOO_LONG, // NJS-186
593
+ 'Application Context key length (%d bytes) exceeds the maximum allowed (%d bytes)');
594
+ messages.set(ERR_APP_CONTEXT_VALUE_TOO_LONG, // NJS-187
595
+ 'Application Context value length (%d bytes) exceeds the maximum allowed (%d bytes)');
596
+ messages.set(ERR_UNSUPPORTED_KEY_LENGTH, // NJS-188
597
+ 'Unsupported encryption key length %d');
598
+ messages.set(ERR_INVALID_END_USER_SECURITY_CONTEXT_LENGTH, // NJS-189
599
+ 'Specified End User Context exceeds the maximum supported size %d');
600
+ messages.set(ERR_END_USER_SECURITY_CONTEXT_REQUIRES_TCPS, // NJS-190
601
+ 'End User Context requires use of the tcps protocol');
602
+ messages.set(ERR_UNSUPPORTED_DEEP_DATA_SECURITY_FEATURE, // NJS-191
603
+ 'database version does not support the Oracle Deep Data Security feature');
604
+ messages.set(ERR_CHAR_CS_NOT_SUPPORTED, // NJS-192
605
+ 'Character set id %d is not supported by node-oracledb in Thin mode');
542
606
 
543
607
  // Oracle Net layer errors
544
608
 
@@ -584,6 +648,8 @@ messages.set(ERR_TNS_NAMES_FILE_MISSING, // NJS-520
584
648
  'cannot connect to Oracle Database. File tnsnames.ora not found in %s');
585
649
  messages.set(ERR_CONNECTION_EOF, // NJS-521
586
650
  'connection to host %s port %d received end-of-file on communication channel. (CONNECTION_ID=%s)');
651
+ messages.set(ERR_CONNECT_DESCRIPTOR_LIMIT_EXCEEDED, // NJS-522
652
+ 'connection string exceeds supported descriptor %s limit of %d');
587
653
  messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG, // NJS-523
588
654
  'Failed to retrieve configuration from Centralized Configuration Provider:\n %s');
589
655
  messages.set(ERR_REGISTER_HOOKFN_CONFIGPROVIDER, // NJS-524
@@ -602,6 +668,8 @@ messages.set(ERR_DATA_COMPRESSION, 'Error during data compression/decompression:
602
668
  // Oracle SUCCESS_WITH_INFO warning
603
669
  messages.set(ERR_CONFIG_PROVIDER_PARAM_TYPE, // NJS-535
604
670
  'Parameter does not have a valid type: %s\n');
671
+ messages.set(ERR_TOO_MANY_REDIRECTS, // NJS-536
672
+ 'Too many connect redirects (limit: %d)');
605
673
  messages.set(WRN_COMPILATION_CREATE, // NJS-700
606
674
  'creation succeeded with compilation errors');
607
675
 
@@ -670,8 +738,8 @@ function assertParamPropInt(obj, parameterNum, propName) {
670
738
  //-----------------------------------------------------------------------------
671
739
  // assertParamPropUnsignedInt()
672
740
  //
673
- // Asserts that the property value of a parameter is a positive integer value
674
- // (or undefined).
741
+ // Asserts that the property value of a parameter is a non-negative integer
742
+ // value (or undefined).
675
743
  //-----------------------------------------------------------------------------
676
744
  function assertParamPropUnsignedInt(obj, parameterNum, propName) {
677
745
  if (obj[propName] !== undefined) {
@@ -779,10 +847,11 @@ function throwErrWithORAError() {
779
847
  //-----------------------------------------------------------------------------
780
848
  // throwNotImplemented()
781
849
  //
782
- // Throws an error that the feature is not supported in Thin mode
850
+ // Throws an error that the feature is not supported in Thin/Thick mode
783
851
  //-----------------------------------------------------------------------------
784
852
  function throwNotImplemented(feature) {
785
- throwErr(ERR_NOT_IMPLEMENTED, feature);
853
+ const settings = require('./settings.js');
854
+ throwErr(ERR_NOT_IMPLEMENTED, feature, settings.thin ? 'Thin' : 'Thick');
786
855
  }
787
856
 
788
857
 
@@ -847,6 +916,7 @@ function throwWrapErr(err, fnOpt) {
847
916
 
848
917
  // define exports
849
918
  module.exports = {
919
+ ERR_TOO_MANY_REDIRECTS,
850
920
  ERR_INTEGRITY_ERROR_CODES,
851
921
  ERR_INVALID_POOL,
852
922
  ERR_INVALID_CONNECTION,
@@ -930,6 +1000,7 @@ module.exports = {
930
1000
  ERR_NO_CONFIG_DIR,
931
1001
  ERR_TNS_ENTRY_NOT_FOUND,
932
1002
  ERR_CONNECTION_EOF,
1003
+ ERR_CONNECT_DESCRIPTOR_LIMIT_EXCEEDED,
933
1004
  ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
934
1005
  ERR_CONFIG_PROVIDER_PARAM_TYPE,
935
1006
  ERR_REGISTER_HOOKFN_CONFIGPROVIDER,
@@ -999,6 +1070,19 @@ module.exports = {
999
1070
  ERR_SESSIONLESS_DIFFERING_METHODS,
1000
1071
  ERR_SESSIONLESS_ALREADY_ACTIVE,
1001
1072
  ERR_SESSIONLESS_INACTIVE,
1073
+ ERR_INVALID_SERVER_RESPONSE,
1074
+ ERR_PAYLOAD_CANNOT_BE_ENQUEUED,
1075
+ ERR_NULLS_NOT_ALLOWED,
1076
+ ERR_DPL_TOO_MUCH_DATA,
1077
+ ERR_DPL_INVALID_ROW_DATA,
1078
+ ERR_APP_CONTEXT_INVALID_KEY_VALUE,
1079
+ ERR_APP_CONTEXT_KEY_TOO_LONG,
1080
+ ERR_APP_CONTEXT_VALUE_TOO_LONG,
1081
+ ERR_UNSUPPORTED_KEY_LENGTH,
1082
+ ERR_APP_CONTEXT_EMPTY_NAMESPACE,
1083
+ ERR_INVALID_END_USER_SECURITY_CONTEXT_LENGTH,
1084
+ ERR_END_USER_SECURITY_CONTEXT_REQUIRES_TCPS,
1085
+ ERR_UNSUPPORTED_DEEP_DATA_SECURITY_FEATURE,
1002
1086
  ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
1003
1087
  ERR_OPERATION_NOT_SUPPORTED_ON_BFILE,
1004
1088
  ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE,
@@ -1015,6 +1099,13 @@ module.exports = {
1015
1099
  ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE,
1016
1100
  ERR_ACCESS_TOKEN,
1017
1101
  ERR_CALLOUT_FN,
1102
+ ERR_PIPELINE_OPERATION_NOT_SUPPORTED,
1103
+ ERR_PIPELINE_MISMATCHED_TOKEN,
1104
+ ERR_PIPELINE_DBOBJECTS_NOT_SUPPORTED,
1105
+ ERR_PIPELINE_LARGE_BUFFERS_NOT_SUPPORTED,
1106
+ ERR_PIPELINE_EXEC_OPTION_NOT_SUPPORTED,
1107
+ ERR_INVALID_SQL_NAME,
1108
+ ERR_CHAR_CS_NOT_SUPPORTED,
1018
1109
  WRN_COMPILATION_CREATE,
1019
1110
  assert,
1020
1111
  assertArgCount,
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -138,6 +138,15 @@ class AqDeqOptionsImpl {
138
138
  errors.throwNotImplemented("setting correlation (dequeue options)");
139
139
  }
140
140
 
141
+ //---------------------------------------------------------------------------
142
+ // setDeliveryMode()
143
+ //
144
+ // Sets the delivery mode to use for dequeuing messages.
145
+ //---------------------------------------------------------------------------
146
+ setDeliveryMode() {
147
+ errors.throwNotImplemented("setting deliveryMode (dequeue options)");
148
+ }
149
+
141
150
  //---------------------------------------------------------------------------
142
151
  // setMode()
143
152
  //
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2026, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -84,13 +84,16 @@ class ConnectionImpl {
84
84
  }
85
85
  traceConfig.serviceName = this.getServiceName();
86
86
  traceConfig.instanceName = this.getInstanceName();
87
- traceConfig.pdbName = this.getDbName();
87
+ traceConfig.pdbName = this.getPdbName();
88
+ traceConfig.dbName = this.getDbName();
89
+ traceConfig.domainName = this.getDbDomain();
88
90
 
89
91
  // Thick mode doesnt have these properties for now.
90
92
  if (settings.thin) {
91
93
  traceConfig.hostName = this.getHostName();
92
94
  traceConfig.port = this.getPort();
93
95
  traceConfig.protocol = this.getProtocol();
96
+ traceConfig.dbUniqueName = this.getDbUniqueName();
94
97
  }
95
98
  return traceConfig;
96
99
  }
@@ -253,6 +256,24 @@ class ConnectionImpl {
253
256
  errors.throwNotImplemented("getting db name");
254
257
  }
255
258
 
259
+ //---------------------------------------------------------------------------
260
+ // getPdbName()
261
+ //
262
+ // Returns the name of a container associated with the connection..
263
+ //---------------------------------------------------------------------------
264
+ getPdbName() {
265
+ errors.throwNotImplemented("getting pdb name");
266
+ }
267
+
268
+ //---------------------------------------------------------------------------
269
+ // getDbUniqueName()
270
+ //
271
+ // Returns the Oracle Database unique name associated with the connection.
272
+ //---------------------------------------------------------------------------
273
+ getDbUniqueName() {
274
+ errors.throwNotImplemented("getting db unique name");
275
+ }
276
+
256
277
  //---------------------------------------------------------------------------
257
278
  // getDbObjectClass()
258
279
  //
@@ -539,6 +560,24 @@ class ConnectionImpl {
539
560
  errors.throwNotImplemented("setting end-to-end attribute 'module'");
540
561
  }
541
562
 
563
+ //---------------------------------------------------------------------------
564
+ // setEndUserSecurityContext()
565
+ //
566
+ // Sets the End Security Context.
567
+ //---------------------------------------------------------------------------
568
+ setEndUserSecurityContext() {
569
+ errors.throwNotImplemented("setting End User Security Context");
570
+ }
571
+
572
+ //---------------------------------------------------------------------------
573
+ // clearEndUserSecurityContext()
574
+ //
575
+ // Clears the End Security Context.
576
+ //---------------------------------------------------------------------------
577
+ clearEndUserSecurityContext() {
578
+ errors.throwNotImplemented("clearing End User Security Context");
579
+ }
580
+
542
581
  //---------------------------------------------------------------------------
543
582
  // setTag()
544
583
  //
@@ -638,6 +677,14 @@ class ConnectionImpl {
638
677
  errors.throwNotImplemented("unsubscribing from events");
639
678
  }
640
679
 
680
+ // supportsPipelining()
681
+ //
682
+ // Returns true if pipelining is supported.
683
+ //---------------------------------------------------------------------------
684
+ supportsPipelining() {
685
+ return false;
686
+ }
687
+
641
688
  //---------------------------------------------------------------------------
642
689
  // getHostName()
643
690
  //
@@ -665,6 +712,33 @@ class ConnectionImpl {
665
712
  errors.throwNotImplemented("getting Protocol");
666
713
  }
667
714
 
715
+ //---------------------------------------------------------------------------
716
+ // directPathLoad()
717
+ //
718
+ // Performs a direct path load into the specified table.
719
+ //---------------------------------------------------------------------------
720
+ directPathLoad() {
721
+ errors.throwNotImplemented("direct path load");
722
+ }
723
+
724
+ //---------------------------------------------------------------------------
725
+ // appContext()
726
+ //
727
+ // Add Application Context, keyValues identified by name, namespaceName.
728
+ //---------------------------------------------------------------------------
729
+ appContext() {
730
+ errors.throwNotImplemented("setting app context");
731
+ }
732
+
733
+ //---------------------------------------------------------------------------
734
+ // clearAppContext()
735
+ //
736
+ // Clears the Application Context, keyValues identified by name.
737
+ //---------------------------------------------------------------------------
738
+ clearAppContext() {
739
+ errors.throwNotImplemented("clear app context");
740
+ }
741
+
668
742
  }
669
743
 
670
744
  // export just the class