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
@@ -74,6 +74,9 @@ class DbObjectPickleBuffer extends GrowableBuffer {
74
74
  obj.imageFlags = this.readUInt8();
75
75
  obj.imageVersion = this.readUInt8();
76
76
  this.readLength();
77
+ if (obj.imageFlags & constants.TNS_OBJ_IS_DEGENERATE) {
78
+ errors.throwNotImplemented('DbObject attributes stored as a locator');
79
+ }
77
80
  if ((obj.imageFlags & constants.TNS_OBJ_NO_PREFIX_SEG) === 0) {
78
81
  const prefixSegLength = this.readLength();
79
82
  this.skipBytes(prefixSegLength);
@@ -366,6 +369,7 @@ class ThinDbObjectImpl extends DbObjectImpl {
366
369
  //---------------------------------------------------------------------------
367
370
  _unpackValue(buf, type, typeClass) {
368
371
  let isNull, obj, value, isCollection;
372
+ const caps = this._objType._connection._protocol.caps;
369
373
  switch (type) {
370
374
  case types.DB_TYPE_NUMBER:
371
375
  return buf.readOracleNumber();
@@ -373,9 +377,11 @@ class ThinDbObjectImpl extends DbObjectImpl {
373
377
  return buf.readBinaryInteger();
374
378
  case types.DB_TYPE_VARCHAR:
375
379
  case types.DB_TYPE_CHAR:
380
+ caps.checkCharsetId();
376
381
  return buf.readStr(constants.CSFRM_IMPLICIT);
377
382
  case types.DB_TYPE_NVARCHAR:
378
383
  case types.DB_TYPE_NCHAR:
384
+ caps.checkNCharsetId();
379
385
  return buf.readStr(constants.CSFRM_NCHAR);
380
386
  case types.DB_TYPE_RAW:
381
387
  value = buf.readBytesWithLength();
@@ -393,7 +399,7 @@ class ThinDbObjectImpl extends DbObjectImpl {
393
399
  case types.DB_TYPE_TIMESTAMP_TZ:
394
400
  return buf.readOracleDate(false);
395
401
  case types.DB_TYPE_BOOLEAN:
396
- return buf.readBool();
402
+ return buf.readBool(true);
397
403
  case types.DB_TYPE_OBJECT:
398
404
  case types.DB_TYPE_XMLTYPE:
399
405
  obj = new ThinDbObjectImpl(typeClass);
package/lib/thin/lob.js CHANGED
@@ -172,6 +172,23 @@ class ThinLobImpl extends LobImpl {
172
172
  return await this._sendMessage(options);
173
173
  }
174
174
 
175
+ //---------------------------------------------------------------------------
176
+ // trim()
177
+ //
178
+ // Internal method for trimming the LOB.
179
+ //---------------------------------------------------------------------------
180
+ async trim(newSize) {
181
+ this.checkConn();
182
+ const options = {
183
+ operation: constants.TNS_LOB_OP_TRIM,
184
+ sourceLobImpl: this,
185
+ sendAmount: true,
186
+ amount: newSize
187
+ };
188
+ await this._sendMessage(options);
189
+ this._length = newSize;
190
+ }
191
+
175
192
  //---------------------------------------------------------------------------
176
193
  // write()
177
194
  //
@@ -186,7 +203,9 @@ class ThinLobImpl extends LobImpl {
186
203
  data: data
187
204
  };
188
205
  await this._sendMessage(options);
189
- this._length += data.length;
206
+ // Take the offset into account while setting the length
207
+ // Note that offset is 1-based
208
+ this._length = Math.max(this._length, (offset - 1) + data.length);
190
209
  }
191
210
 
192
211
  //---------------------------------------------------------------------------
package/lib/thin/pool.js CHANGED
@@ -28,10 +28,10 @@
28
28
 
29
29
  const PoolImpl = require('../impl/pool.js');
30
30
  const ThinConnectionImpl = require('./connection.js');
31
- const protocolUtil = require('./protocol/utils.js');
32
31
  const errors = require('../errors.js');
33
32
  const settings = require('../settings.js');
34
33
  const util = require('../util.js');
34
+ const { ObfuscatedValue } = require('../obfuscation.js');
35
35
  const thinUtil = require('./util.js');
36
36
  const {getConnectionInfo} = require('./sqlnet/networkSession.js');
37
37
  const crypto = require('crypto');
@@ -65,15 +65,11 @@ class ThinPoolImpl extends PoolImpl {
65
65
  this._userConfig = params;
66
66
  this._freeConnectionList = [];
67
67
  this._usedConnectionList = new Set();
68
- this._password = params.password;
69
- this._walletPassword = params.walletPassword;
70
- this._walletContent = params.walletContent;
71
- this._obfuscatedPassword = [];
72
- this._obfuscatedWalletPassword = [];
73
- this._token = params.token;
74
- this._obfuscatedToken = [];
75
- this._privateKey = params.privateKey;
76
- this._obfuscatedPrivateKey = [];
68
+ this._password = new ObfuscatedValue();
69
+ this._walletPassword = new ObfuscatedValue();
70
+ this._walletContent = new ObfuscatedValue();
71
+ this._token = new ObfuscatedValue();
72
+ this._privateKey = new ObfuscatedValue();
77
73
  this._schedulerJob = null;
78
74
  this._poolCloseWaiter = null;
79
75
  this._pendingRequests = [];
@@ -82,38 +78,28 @@ class ThinPoolImpl extends PoolImpl {
82
78
  this._poolCloseCleaner = null;
83
79
 
84
80
  // password obfuscation
85
- if (this._password !== undefined) {
86
- const obj = protocolUtil.setObfuscatedValue(this._password);
87
- this._password = obj.value;
88
- this._obfuscatedPassword = obj.obfuscatedValue;
81
+ if (params.password !== undefined) {
82
+ this._password.set(params.password);
89
83
  this._userConfig.password = null;
90
84
  }
91
85
  // wallet password obfuscation
92
- if (this._walletPassword !== undefined) {
93
- const obj = protocolUtil.setObfuscatedValue(this._walletPassword);
94
- this._walletPassword = obj.value;
95
- this._obfuscatedWalletPassword = obj.obfuscatedValue;
86
+ if (params.walletPassword !== undefined) {
87
+ this._walletPassword.set(params.walletPassword);
96
88
  this._userConfig.walletPassword = null;
97
89
  }
98
90
  // wallet content obfuscation
99
- if (this._walletContent !== undefined) {
100
- const obj = protocolUtil.setObfuscatedValue(this._walletContent);
101
- this._walletContent = obj.value;
102
- this._obfuscatedWalletContent = obj.obfuscatedValue;
103
- this._userConfig.walletConent = null;
91
+ if (params.walletContent !== undefined) {
92
+ this._walletContent.set(params.walletContent);
93
+ this._userConfig.walletContent = null;
104
94
  }
105
95
  // token obfuscation
106
- if (this._token !== undefined) {
107
- const obj = protocolUtil.setObfuscatedValue(this._token);
108
- this._token = obj.value;
109
- this._obfuscatedToken = obj.obfuscatedValue;
96
+ if (params.token !== undefined) {
97
+ this._token.set(params.token);
110
98
  this._userConfig.token = null;
111
99
  }
112
100
  // privateKey obfuscation
113
- if (this._privateKey !== undefined) {
114
- const obj = protocolUtil.setObfuscatedValue(this._privateKey);
115
- this._privateKey = obj.value;
116
- this._obfuscatedPrivateKey = obj.obfuscatedValue;
101
+ if (params.privateKey !== undefined) {
102
+ this._privateKey.set(params.privateKey);
117
103
  this._userConfig.privateKey = null;
118
104
  }
119
105
  this._accessTokenFn = params.accessTokenFn;
@@ -128,6 +114,7 @@ class ThinPoolImpl extends PoolImpl {
128
114
  //---------------------------------------------------------------------------
129
115
  async create(params) {
130
116
  this._init(params);
117
+ this._eventCallback = params.poolEventReg;
131
118
  this._userConfig._connInfo =
132
119
  await getConnectionInfo(params);
133
120
  this._isDRCPEnabled =
@@ -150,16 +137,12 @@ class ThinPoolImpl extends PoolImpl {
150
137
  //---------------------------------------------------------------------------
151
138
  setAccessToken(params) {
152
139
  if (params.token) {
153
- this._token = params.token;
154
- const objToken = protocolUtil.setObfuscatedValue(this._token);
155
- this._token = objToken.value;
156
- this._obfuscatedToken = objToken.obfuscatedValue;
140
+ this._token.set(params.token);
141
+ this._userConfig.token = null;
157
142
  }
158
143
  if (params.privateKey) {
159
- this._privateKey = params.privateKey;
160
- const objKey = protocolUtil.setObfuscatedValue(this._privateKey);
161
- this._privateKey = objKey.value;
162
- this._obfuscatedPrivateKey = objKey.obfuscatedValue;
144
+ this._privateKey.set(params.privateKey);
145
+ this._userConfig.privateKey = null;
163
146
  }
164
147
  }
165
148
 
@@ -173,29 +156,23 @@ class ThinPoolImpl extends PoolImpl {
173
156
  const clonedAttrs = Object.assign({}, this._userConfig);
174
157
  // deobfuscate password
175
158
  if (clonedAttrs.password === null) {
176
- clonedAttrs.password = protocolUtil.getDeobfuscatedValue(this._password,
177
- this._obfuscatedPassword);
159
+ clonedAttrs.password = this._password.get();
178
160
  }
179
161
 
180
162
  // deobfuscate wallet password
181
163
  if (clonedAttrs.walletPassword === null) {
182
- clonedAttrs.walletPassword =
183
- protocolUtil.getDeobfuscatedValue(this._walletPassword,
184
- this._obfuscatedWalletPassword);
164
+ clonedAttrs.walletPassword = this._walletPassword.get();
185
165
  }
186
166
 
187
167
  // deobfuscate wallet content
188
168
  if (clonedAttrs.walletContent === null) {
189
- clonedAttrs.walletContent =
190
- protocolUtil.getDeobfuscatedValue(this._walletContent,
191
- this._obfuscatedWalletContent);
169
+ clonedAttrs.walletContent = this._walletContent.get();
192
170
  }
193
171
 
194
172
  // deobfuscate token and private key
195
173
  // check for token expiry
196
174
  if (clonedAttrs.token === null) {
197
- clonedAttrs.token =
198
- protocolUtil.getDeobfuscatedValue(this._token, this._obfuscatedToken);
175
+ clonedAttrs.token = this._token.get();
199
176
  if (util.isTokenExpired(clonedAttrs.token)) {
200
177
  if (typeof this._accessTokenFn === 'function') {
201
178
  try {
@@ -210,9 +187,7 @@ class ThinPoolImpl extends PoolImpl {
210
187
  errors.throwErr(errors.ERR_TOKEN_HAS_EXPIRED);
211
188
  } else {
212
189
  // update pool with OAuth2 token
213
- const obj = protocolUtil.setObfuscatedValue(clonedAttrs.token);
214
- this._token = obj.value;
215
- this._obfuscatedToken = obj.obfuscatedValue;
190
+ this._token.set(clonedAttrs.token);
216
191
  }
217
192
  } else if (typeof accessToken === 'object') {
218
193
  clonedAttrs.token = accessToken.token;
@@ -222,12 +197,8 @@ class ThinPoolImpl extends PoolImpl {
222
197
  errors.throwErr(errors.ERR_TOKEN_HAS_EXPIRED);
223
198
  } else {
224
199
  // update pool with IAM token and private key
225
- const objToken = protocolUtil.setObfuscatedValue(clonedAttrs.token);
226
- this._token = objToken.value;
227
- this._obfuscatedToken = objToken.obfuscatedValue;
228
- const objKey = protocolUtil.setObfuscatedValue(clonedAttrs.privateKey);
229
- this._privateKey = objKey.value;
230
- this._obfuscatedPrivateKey = objKey.obfuscatedValue;
200
+ this._token.set(clonedAttrs.token);
201
+ this._privateKey.set(clonedAttrs.privateKey);
231
202
  }
232
203
  }
233
204
  } else {
@@ -236,9 +207,7 @@ class ThinPoolImpl extends PoolImpl {
236
207
  }
237
208
  }
238
209
  if (clonedAttrs.privateKey === null) {
239
- clonedAttrs.privateKey =
240
- protocolUtil.getDeobfuscatedValue(this._privateKey,
241
- this._obfuscatedPrivateKey);
210
+ clonedAttrs.privateKey = this._privateKey.get();
242
211
  }
243
212
  return clonedAttrs;
244
213
  }
@@ -259,8 +228,10 @@ class ThinPoolImpl extends PoolImpl {
259
228
  if (connection.nscon.ntAdapter.connected) {
260
229
  connection._dropSess = true;
261
230
  await connection.close();
231
+ // emit pool event when a connection is destroyed
232
+ this._eventCallback("onPoolShrink");
262
233
  }
263
- } catch (err) {
234
+ } catch {
264
235
  return;
265
236
  }
266
237
  }
@@ -301,6 +272,10 @@ class ThinPoolImpl extends PoolImpl {
301
272
  if (this._bgCleaner)
302
273
  this._bgCleaner();
303
274
  });
275
+
276
+ // clear _eventCallback to break the reference cycle created by the closure
277
+ // capturing the user pool object.
278
+ this._eventCallback = null;
304
279
  }
305
280
 
306
281
  //---------------------------------------------------------------------------
@@ -473,6 +448,9 @@ class ThinPoolImpl extends PoolImpl {
473
448
  conn._creationTime = Date.now();
474
449
  conn._lastTimeUsed = Date.now();
475
450
  this._freeConnectionList.push(conn);
451
+
452
+ // emit pool event when new connections are created in background
453
+ this._eventCallback("onPoolExpand");
476
454
  } catch (err) {
477
455
  this._bgErr = err;
478
456
  }
@@ -589,6 +567,7 @@ class ThinPoolImpl extends PoolImpl {
589
567
 
590
568
  // connection has passed health checks, return it immediately
591
569
  this._usedConnectionList.add(conn);
570
+ this._eventCallback("onPoolConnectionHit");
592
571
  return conn;
593
572
 
594
573
  }
@@ -619,6 +598,7 @@ class ThinPoolImpl extends PoolImpl {
619
598
  }
620
599
  // return a connection from the ones that were just built
621
600
  const conn = this._freeConnectionList.pop();
601
+ this._eventCallback("onPoolConnectionMiss");
622
602
  this._usedConnectionList.add(conn);
623
603
  return conn;
624
604
  }
@@ -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
  //
@@ -42,11 +42,13 @@ class Capabilities {
42
42
  this.supports12cLogon = true;
43
43
  this.supportsOob = false;
44
44
  this.nCharsetId = constants.TNS_CHARSET_UTF16;
45
+ this.charsetId = constants.TNS_CHARSET_UTF8;
45
46
  this.compileCaps = Buffer.alloc(constants.TNS_CCAP_MAX);
46
47
  this.runtimeCaps = Buffer.alloc(constants.TNS_RCAP_MAX);
47
48
  this.initCompileCaps(nscon);
48
49
  this.initRuntimeCaps();
49
50
  this.maxStringSize = 0;
51
+ this.supportsEndUserSecurityContext = false;
50
52
  }
51
53
 
52
54
  adjustForServerCompileCaps(serverCaps, nscon) {
@@ -62,6 +64,11 @@ class Capabilities {
62
64
  ^= constants.TNS_CCAP_END_OF_REQUEST;
63
65
  nscon.endOfRequestSupport = false;
64
66
  }
67
+ const bpIndex = constants.TNS_CCAP_FEATURE_BACKPORT2;
68
+ if (bpIndex < serverCaps.length &&
69
+ (serverCaps[bpIndex] & constants.TNS_CCAP_END_USER_SEC_CTX_PIGGYBACK)) {
70
+ this.supportsEndUserSecurityContext = true;
71
+ }
65
72
  }
66
73
 
67
74
  adjustForServerRuntimeCaps(serverCaps) {
@@ -81,6 +88,7 @@ class Capabilities {
81
88
  constants.TNS_CCAP_O9LOGON_LONG_PASSWORD;
82
89
  this.compileCaps[constants.TNS_CCAP_FIELD_VERSION] = this.ttcFieldVersion;
83
90
  this.compileCaps[constants.TNS_CCAP_SERVER_DEFINE_CONV] = 1;
91
+ this.compileCaps[constants.TNS_CCAP_DEQUEUE_WITH_SELECTOR] = 1;
84
92
  this.compileCaps[constants.TNS_CCAP_TTC1] =
85
93
  constants.TNS_CCAP_FAST_BVEC | constants.TNS_CCAP_END_OF_CALL_STATUS |
86
94
  constants.TNS_CCAP_IND_RCD;
@@ -118,12 +126,17 @@ class Capabilities {
118
126
  this.compileCaps[constants.TNS_CCAP_TTC4] |= constants.TNS_CCAP_END_OF_REQUEST;
119
127
  }
120
128
  this.compileCaps[constants.TNS_CCAP_CTB_FEATURE_BACKPORT] =
121
- constants.TNS_CCAP_CTB_IMPLICIT_POOL;
129
+ constants.TNS_CCAP_CTB_IMPLICIT_POOL |
130
+ constants.TNS_CCAP_CTB_OAUTH_MSG_ON_ERR;
122
131
  this.compileCaps[constants.TNS_CCAP_TTC5] =
123
132
  constants.TNS_CCAP_VECTOR_SUPPORT |
133
+ constants.TNS_CCAP_TOKEN_SUPPORTED |
134
+ constants.TNS_CCAP_PIPELINING_SUPPORT |
135
+ constants.TNS_CCAP_PIPELINING_BREAK |
124
136
  constants.TNS_CCAP_TTC5_SESSIONLESS_TXNS;
125
137
  this.compileCaps[constants.TNS_CCAP_VECTOR_FEATURES] =
126
138
  constants.TNS_CCAP_VECTOR_FEATURE_BINARY | constants.TNS_CCAP_VECTOR_FEATURE_SPARSE;
139
+ this.compileCaps[constants.TNS_CCAP_FEATURE_BACKPORT2] = constants.TNS_CCAP_END_USER_SEC_CTX_PIGGYBACK;
127
140
  }
128
141
 
129
142
  initRuntimeCaps() {
@@ -133,9 +146,13 @@ class Capabilities {
133
146
  }
134
147
 
135
148
  checkNCharsetId() {
136
- if (this.nCharsetId !== constants.TNS_CHARSET_UTF16) {
149
+ if (this.nCharsetId !== constants.TNS_CHARSET_UTF16)
137
150
  errors.throwErr(errors.ERR_NCHAR_CS_NOT_SUPPORTED, this.nCharsetId);
138
- }
151
+ }
152
+
153
+ checkCharsetId() {
154
+ if (this.charsetId !== constants.TNS_CHARSET_UTF8)
155
+ errors.throwErr(errors.ERR_CHAR_CS_NOT_SUPPORTED, this.charsetId);
139
156
  }
140
157
 
141
158
  }
@@ -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
  //
@@ -407,7 +407,12 @@ module.exports = {
407
407
  TNS_DATA_TYPE_OAC: 646,
408
408
  TNS_DATA_TYPE_SESSSIGN: 647,
409
409
  TNS_DATA_TYPE_OER: 652,
410
+ TNS_DATA_TYPE_PLEND: 660,
411
+ TNS_DATA_TYPE_PLBGN: 661,
410
412
  TNS_DATA_TYPE_UDS: 663,
413
+ TNS_DATA_TYPE_PLOP: 665,
414
+ TNS_DATA_TYPE_KVE: 669,
415
+ TNS_DATA_TYPE_EUSC: 670,
411
416
 
412
417
  // data type representations
413
418
  TNS_TYPE_REP_NATIVE: 0,
@@ -435,12 +440,15 @@ module.exports = {
435
440
  TNS_MSG_TYPE_IMPLICIT_RESULTSET: 27,
436
441
  TNS_MSG_TYPE_RENEGOTIATE: 28,
437
442
  TNS_MSG_TYPE_END_OF_REQUEST: 29,
443
+ TNS_MSG_TYPE_TOKEN: 33,
438
444
  TNS_MSG_TYPE_FAST_AUTH: 34,
439
445
 
440
446
  // parameter keyword numbers,
441
447
  TNS_KEYWORD_NUM_CURRENT_SCHEMA: 168,
442
448
  TNS_KEYWORD_NUM_EDITION: 172,
443
449
  TNS_KEYWORD_NUM_TRANSACTION_ID: 201,
450
+ TNS_KEYWORD_PDBNAME: 197, // Container Name
451
+ TNS_KEYWORD_DBNAME: 179, // Global DB Name
444
452
 
445
453
  // bind flags
446
454
  TNS_BIND_USE_INDICATORS: 0x0001,
@@ -541,13 +549,20 @@ module.exports = {
541
549
  // TTC functions
542
550
  TNS_FUNC_AUTH_PHASE_ONE: 118,
543
551
  TNS_FUNC_AUTH_PHASE_TWO: 115,
552
+ TNS_FUNC_APP_CONTEXT: 154,
544
553
  TNS_FUNC_CLOSE_CURSORS: 105,
545
554
  TNS_FUNC_COMMIT: 14,
555
+ TNS_FUNC_DIRECT_PATH_LOAD_STREAM: 129,
556
+ TNS_FUNC_DIRECT_PATH_OP: 130,
557
+ TNS_FUNC_DIRECT_PATH_PREPARE: 128,
558
+ TNS_FUNC_END_USER_SECURITY_CTX: 205,
546
559
  TNS_FUNC_EXECUTE: 94,
547
560
  TNS_FUNC_FETCH: 5,
548
561
  TNS_FUNC_LOB_OP: 96,
549
562
  TNS_FUNC_LOGOFF: 9,
550
563
  TNS_FUNC_PING: 147,
564
+ TNS_FUNC_PIPELINE_BEGIN: 199,
565
+ TNS_FUNC_PIPELINE_END: 200,
551
566
  TNS_FUNC_ROLLBACK: 15,
552
567
  TNS_FUNC_SET_END_TO_END_ATTR: 135,
553
568
  TNS_FUNC_REEXECUTE: 4,
@@ -559,6 +574,9 @@ module.exports = {
559
574
  TNS_FUNC_CANCEL_ALL: 120, // piggyback fn
560
575
  TNS_FUNC_TPC_TXN_SWITCH: 103,
561
576
  TNS_FUNC_TPC_TXN_CHANGE_STATE: 104,
577
+ TNS_FUNC_AQ_ENQ: 121,
578
+ TNS_FUNC_AQ_DEQ: 122,
579
+ TNS_FUNC_ARRAY_AQ: 145,
562
580
 
563
581
  // character sets and encodings
564
582
  TNS_CHARSET_UTF8: 873,
@@ -574,6 +592,7 @@ module.exports = {
574
592
  TNS_CCAP_CTB_FEATURE_BACKPORT: 5,
575
593
  TNS_CCAP_FIELD_VERSION: 7,
576
594
  TNS_CCAP_SERVER_DEFINE_CONV: 8,
595
+ TNS_CCAP_DEQUEUE_WITH_SELECTOR: 9,
577
596
  TNS_CCAP_TTC1: 15,
578
597
  TNS_CCAP_OCI1: 16,
579
598
  TNS_CCAP_TDS_VERSION: 17,
@@ -591,6 +610,7 @@ module.exports = {
591
610
  TNS_CCAP_TTC4: 40,
592
611
  TNS_CCAP_LOB2: 42,
593
612
  TNS_CCAP_TTC5: 44,
613
+ TNS_CCAP_FEATURE_BACKPORT2: 45,
594
614
  TNS_CCAP_VECTOR_FEATURES: 52,
595
615
  TNS_CCAP_MAX: 53,
596
616
 
@@ -648,11 +668,16 @@ module.exports = {
648
668
  TNS_CCAP_LOB2_QUASI: 0x01,
649
669
  TNS_CCAP_LOB2_2GB_PREFETCH: 0x04,
650
670
  TNS_CCAP_CTB_IMPLICIT_POOL: 0x08,
671
+ TNS_CCAP_CTB_OAUTH_MSG_ON_ERR: 0x10,
651
672
  TNS_CCAP_VECTOR_SUPPORT: 0x08,
673
+ TNS_CCAP_TOKEN_SUPPORTED: 0x02,
674
+ TNS_CCAP_PIPELINING_SUPPORT: 0x04,
675
+ TNS_CCAP_PIPELINING_BREAK: 0x10,
652
676
  TNS_CCAP_VECTOR_FEATURE_BINARY: 0x01,
653
677
  TNS_CCAP_VECTOR_FEATURE_SPARSE: 0x02,
654
678
  TNS_CCAP_TTC5_SESSIONLESS_TXNS: 0x20,
655
679
  TNS_CCAP_OCI3_OCSSYNC: 0x20,
680
+ TNS_CCAP_END_USER_SEC_CTX_PIGGYBACK: 0x02,
656
681
 
657
682
  // runtime capability indices
658
683
  TNS_RCAP_COMPAT: 0,
@@ -716,6 +741,113 @@ module.exports = {
716
741
  TNS_TPC_TRANS_TRANSACTION_ID_SYNC_CLIENT: 0x02,
717
742
  TNS_TPC_TRANS_TRANSACTION_ID_SYNC_TXEND_XA: 0x03,
718
743
 
744
+ // AQ Delivery modes
745
+ TNS_AQ_MSG_PERSISTENT: constants.AQ_MSG_DELIV_MODE_PERSISTENT,
746
+ TNS_AQ_MSG_BUFFERED: constants.AQ_MSG_DELIV_MODE_BUFFERED,
747
+ TNS_AQ_MSG_PERSISTENT_OR_BUFFERED: constants.AQ_MSG_DELIV_MODE_PERSISTENT_OR_BUFFERED,
748
+
749
+ // AQ dequeue modes
750
+ TNS_AQ_DEQ_BROWSE: 1,
751
+ TNS_AQ_DEQ_LOCKED: 2,
752
+ TNS_AQ_DEQ_REMOVE: 3,
753
+ TNS_AQ_DEQ_REMOVE_NODATA: 4,
754
+
755
+ // AQ dequeue navigation modes
756
+ TNS_AQ_DEQ_FIRST_MSG: 1,
757
+ TNS_AQ_DEQ_NEXT_MSG: 3,
758
+ TNS_AQ_DEQ_NEXT_TRANSACTION: 2,
759
+
760
+ // AQ dequeue visibility modes
761
+ TNS_AQ_DEQ_IMMEDIATE: 1,
762
+ TNS_AQ_DEQ_ON_COMMIT: 2,
763
+
764
+ // AQ dequeue wait modes
765
+ TNS_AQ_DEQ_NO_WAIT: 0,
766
+ TNS_AQ_DEQ_WAIT_FOREVER: 0xFFFFFFFF,
767
+
768
+ // AQ enqueue visibility modes
769
+ TNS_AQ_ENQ_IMMEDIATE: 1,
770
+ TNS_AQ_ENQ_ON_COMMIT: 2,
771
+
772
+ // AQ message states
773
+ TNS_AQ_MSG_EXPIRED: 3,
774
+ TNS_AQ_MSG_PROCESSED: 2,
775
+ TNS_AQ_MSG_READY: 0,
776
+ TNS_AQ_MSG_WAITING: 1,
777
+
778
+ // AQ other constants
779
+ TNS_AQ_MSG_NO_DELAY: 0,
780
+ TNS_AQ_MSG_NO_EXPIRATION: -1,
781
+ TNS_AQ_ARRAY_ENQ: 0x01,
782
+ TNS_AQ_ARRAY_DEQ: 0x02,
783
+ TNS_AQ_ARRAY_FLAGS_RETURN_MESSAGE_ID: 0x01,
784
+ TNS_TTC_ENQ_STREAMING_ENABLED: 0x00000001,
785
+ TNS_TTC_ENQ_STREAMING_DISABLED: 0x00000000,
786
+
787
+ // AQ flags
788
+ TNS_KPD_AQ_BUFMSG: 0x02,
789
+ TNS_KPD_AQ_EITHER: 0x10,
790
+
791
+ TNS_AQ_MESSAGE_ID_LENGTH: 16,
792
+ TNS_AQ_MESSAGE_VERSION: 1,
793
+
794
+ TNS_AQ_EXT_KEYWORD_AGENT_NAME: 64,
795
+ TNS_AQ_EXT_KEYWORD_AGENT_ADDRESS: 65,
796
+ TNS_AQ_EXT_KEYWORD_AGENT_PROTOCOL: 66,
797
+ TNS_AQ_EXT_KEYWORD_ORIGINAL_MSGID: 69,
798
+
799
+ // direct path constants
800
+ TNS_DP_INTERFACE_VERSION: 400,
801
+ TNS_DP_STREAM_VERSION: 400,
802
+
803
+ // direct path op codes
804
+ TNS_DPP_OP_CODE_LOAD: 1,
805
+ TNS_DPP_OP_CODE_UNLOAD: 2,
806
+ TNS_DPP_OP_CODE_CONVERT: 3,
807
+
808
+ // direct path prepare input indexes
809
+ TNS_DPP_IN_INDEX_INTERFACE_VERSION: 0,
810
+ TNS_DPP_IN_INDEX_STREAM_VERSION: 1,
811
+ TNS_DPP_IN_INDEX_LOCK_WAIT: 14,
812
+ TNS_DPP_IN_MAX_PARAMS: 36,
813
+
814
+ // direct path prepare keyword indexes
815
+ TNS_DPP_KW_INDEX_OBJECT_NAME: 1,
816
+ TNS_DPP_KW_INDEX_SUBOBJECT_NAME: 2,
817
+ TNS_DPP_KW_INDEX_SCHEMA_NAME: 3,
818
+ TNS_DPP_KW_INDEX_COLUMN_NAME: 4,
819
+ TNS_DPP_KW_INDEX_VARRAY_TABLE: 15,
820
+ TNS_DPP_KW_INDEX_NFOBJ_OID_POS: 11,
821
+ TNS_DPP_KW_INDEX_NFOBJ_SID_POS: 16,
822
+ TNS_DPP_KW_INDEX_NFOBJ_VARRAY_INDEX: 17,
823
+
824
+ // direct path prepare output indexes
825
+ TNS_DPP_OUT_INDEX_CURSOR: 3,
826
+ TNS_DPP_OUT_MAX_PARAMS: 14,
827
+
828
+ // direct path row header flags
829
+ TNS_DPLS_ROW_HEADER_FAST_PIECE: 0x10,
830
+ TNS_DPLS_ROW_HEADER_FAST_ROW: 0x20,
831
+ TNS_DPLS_ROW_HEADER_FIRST: 0x08,
832
+ TNS_DPLS_ROW_HEADER_LAST: 0x04,
833
+ TNS_DPLS_ROW_HEADER_SPLIT_WITH_PREV: 0x02,
834
+ TNS_DPLS_ROW_HEADER_SPLIT_WITH_NEXT: 0x01,
835
+
836
+ // other direct path load stream constants
837
+ TNS_DPLS_MAX_BUFFER_SIZE_FACTOR: 22,
838
+ TNS_DPLS_MAX_SHORT_LENGTH: 0xfa,
839
+ TNS_DPLS_MAX_MESSAGE_SIZE: 1073728895,
840
+ TNS_DPLS_MAX_PIECE_SIZE: 0xfff0,
841
+ TNS_DPLS_FAST_HEADER_SIZE: 4,
842
+ TNS_DPLS_SLOW_HEADER_SIZE: 2,
843
+
844
+ // direct path operation codes
845
+ TNS_DP_OP_ABORT: 1,
846
+ TNS_DP_OP_FINISH: 2,
847
+
848
+ // Security Context constants
849
+ TNS_OSON_SEC_CTX_MAX_FNAME_SIZE: 255,
850
+ TNS_SECURITY_CONTEXT_ATTACH_FLAG: 0x01,
719
851
 
720
852
  // other constants
721
853
  TNS_ESCAPE_CHAR: 253,
@@ -788,6 +920,7 @@ module.exports = {
788
920
  TNS_ERR_INVALID_SID: 12505,
789
921
  TNS_ERR_NO_DATA_FOUND: 1403,
790
922
  TNS_ERR_SESSION_SHUTDOWN: 12572,
923
+ TNS_ERR_NO_MESSAGES_FOUND: 25228,
791
924
 
792
925
  // warnings
793
926
  TNS_WARN_COMPILATION_CREATE: 0x20,
@@ -804,8 +937,16 @@ module.exports = {
804
937
  CHUNKED_BYTES_CHUNK_SIZE: 65536,
805
938
 
806
939
  // Network Header flags for Data packet
807
- TNS_DATA_FLAGS_END_OF_REQUEST: 0x2000,
940
+ TNS_DATA_FLAGS_BEGIN_PIPELINE: 0x1000,
941
+ TNS_DATA_FLAGS_END_OF_REQUEST: 0x800,
942
+ TNS_DATA_FLAGS_END_OF_RESPONSE: 0x2000,
943
+ TNS_DATA_FLAGS_OFFSET: 0x8,
808
944
 
945
+ // pipeline modes
946
+ TNS_PIPELINE_MODE_CONTINUE_ON_ERROR: 1,
947
+ TNS_PIPELINE_MODE_ABORT_ON_ERROR: 2,
948
+
949
+ // base 64 encoding alphabet
809
950
  TNS_BASE64_ALPHABET_ARRAY: Buffer.from('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'),
810
951
  TNS_EXTENT_OID: Buffer.from('00000000000000000000000000010001', 'hex')
811
952
  };