oracledb 6.8.0 → 6.10.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 (85) hide show
  1. package/README.md +39 -3
  2. package/build/Release/oracledb-6.10.0-darwin-arm64.node +0 -0
  3. package/build/Release/oracledb-6.10.0-darwin-arm64.node-buildinfo.txt +1 -0
  4. package/build/Release/oracledb-6.10.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-6.10.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-6.10.0-js-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-6.10.0-linux-arm64.node +0 -0
  8. package/build/Release/oracledb-6.10.0-linux-arm64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.10.0-linux-x64.node +0 -0
  10. package/build/Release/oracledb-6.10.0-linux-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.10.0-win32-x64.node +0 -0
  12. package/build/Release/oracledb-6.10.0-win32-x64.node-buildinfo.txt +1 -0
  13. package/lib/aqDeqOptions.js +18 -1
  14. package/lib/aqMessage.js +10 -1
  15. package/lib/aqQueue.js +10 -6
  16. package/lib/configProviders/file.js +72 -0
  17. package/lib/connection.js +93 -4
  18. package/lib/dbObject.js +34 -4
  19. package/lib/errors.js +70 -35
  20. package/lib/impl/aqDeqOptions.js +10 -1
  21. package/lib/impl/connection.js +9 -0
  22. package/lib/impl/datahandlers/buffer.js +49 -0
  23. package/lib/impl/datahandlers/oson.js +7 -2
  24. package/lib/impl/pool.js +10 -1
  25. package/lib/impl/resultset.js +5 -4
  26. package/lib/impl/sodaDocument.js +5 -14
  27. package/lib/lob.js +9 -1
  28. package/lib/oracledb.js +152 -30
  29. package/lib/pool.js +199 -147
  30. package/lib/poolStatistics.js +4 -2
  31. package/lib/sodaCollection.js +12 -8
  32. package/lib/sodaDatabase.js +35 -8
  33. package/lib/sodaDocument.js +24 -6
  34. package/lib/sodaOperation.js +7 -6
  35. package/lib/thin/aq.js +475 -0
  36. package/lib/thin/connection.js +171 -14
  37. package/lib/thin/dbObject.js +8 -6
  38. package/lib/thin/lob.js +2 -3
  39. package/lib/thin/pool.js +105 -28
  40. package/lib/thin/protocol/capabilities.js +10 -4
  41. package/lib/thin/protocol/constants.js +90 -1
  42. package/lib/thin/protocol/encryptDecrypt.js +2 -2
  43. package/lib/thin/protocol/messages/aqArray.js +238 -0
  44. package/lib/thin/protocol/messages/aqBase.js +305 -0
  45. package/lib/thin/protocol/messages/aqDeq.js +164 -0
  46. package/lib/thin/protocol/messages/aqEnq.js +135 -0
  47. package/lib/thin/protocol/messages/auth.js +25 -27
  48. package/lib/thin/protocol/messages/base.js +98 -9
  49. package/lib/thin/protocol/messages/dataType.js +2 -1
  50. package/lib/thin/protocol/messages/execute.js +46 -4
  51. package/lib/thin/protocol/messages/lobOp.js +5 -22
  52. package/lib/thin/protocol/messages/logOff.js +0 -1
  53. package/lib/thin/protocol/messages/sessionRelease.js +0 -1
  54. package/lib/thin/protocol/messages/transactionSwitch.js +12 -4
  55. package/lib/thin/protocol/messages/withData.js +3 -3
  56. package/lib/thin/protocol/packet.js +6 -5
  57. package/lib/thin/protocol/protocol.js +2 -1
  58. package/lib/thin/sqlnet/connStrategy.js +2 -1
  59. package/lib/thin/sqlnet/navNodes.js +1 -1
  60. package/lib/thin/sqlnet/networkSession.js +10 -4
  61. package/lib/thin/sqlnet/packet.js +2 -1
  62. package/lib/thin/sqlnet/sessionAtts.js +2 -3
  63. package/lib/types.js +6 -11
  64. package/lib/util.js +72 -11
  65. package/lib/version.js +1 -1
  66. package/package/install.js +3 -3
  67. package/package/prunebinaries.js +6 -12
  68. package/package.json +2 -2
  69. package/{lib/configProviders/azure.js → plugins/configProviders/azure/index.js} +73 -63
  70. package/plugins/configProviders/azurevault/index.js +84 -0
  71. package/{lib → plugins}/configProviders/base.js +13 -3
  72. package/{lib/configProviders/ociobject.js → plugins/configProviders/ociobject/index.js} +43 -78
  73. package/plugins/configProviders/ocivault/index.js +100 -0
  74. package/plugins/token/extensionOci/index.js +71 -35
  75. package/build/Release/oracledb-6.8.0-darwin-arm64.node +0 -0
  76. package/build/Release/oracledb-6.8.0-darwin-arm64.node-buildinfo.txt +0 -1
  77. package/build/Release/oracledb-6.8.0-darwin-x64.node +0 -0
  78. package/build/Release/oracledb-6.8.0-darwin-x64.node-buildinfo.txt +0 -1
  79. package/build/Release/oracledb-6.8.0-js-buildinfo.txt +0 -1
  80. package/build/Release/oracledb-6.8.0-linux-arm64.node +0 -0
  81. package/build/Release/oracledb-6.8.0-linux-arm64.node-buildinfo.txt +0 -1
  82. package/build/Release/oracledb-6.8.0-linux-x64.node +0 -0
  83. package/build/Release/oracledb-6.8.0-linux-x64.node-buildinfo.txt +0 -1
  84. package/build/Release/oracledb-6.8.0-win32-x64.node +0 -0
  85. package/build/Release/oracledb-6.8.0-win32-x64.node-buildinfo.txt +0 -1
package/lib/errors.js CHANGED
@@ -175,6 +175,11 @@ const ERR_DB_FETCH_TYPE_HANDLER_CONVERTER = 166;
175
175
  const ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE = 167;
176
176
  const ERR_ACCESS_TOKEN = 168;
177
177
  const ERR_CALLOUT_FN = 169;
178
+ const ERR_SESSIONLESS_DIFFERING_METHODS = 170;
179
+ const ERR_SESSIONLESS_ALREADY_ACTIVE = 171;
180
+ const ERR_SESSIONLESS_INACTIVE = 172;
181
+ const ERR_INVALID_SERVER_RESPONSE = 173;
182
+ const ERR_PAYLOAD_CANNOT_BE_ENQUEUED = 174;
178
183
 
179
184
  // Oracle Net layer errors start from 500
180
185
  const ERR_CONNECTION_CLOSED = 500;
@@ -198,19 +203,15 @@ const ERR_INVALID_SERVICE_NAME = 518;
198
203
  const ERR_INVALID_SID = 519;
199
204
  const ERR_TNS_NAMES_FILE_MISSING = 520;
200
205
  const ERR_CONNECTION_EOF = 521;
201
- const ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED = 522;
202
206
  const ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG = 523;
203
- const ERR_CONFIG_PROVIDER_NOT_SUPPORTED = 524;
204
- const ERR_CONFIG_PROVIDER_LOAD_FAILED = 525;
205
- const ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED = 526;
206
- const ERR_AZURE_VAULT_AUTH_FAILED = 527;
207
- const ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED = 528;
207
+ const ERR_REGISTER_HOOKFN_CONFIGPROVIDER = 524;
208
208
  const ERR_WALLET_TYPE_NOT_SUPPORTED = 529;
209
209
  const ERR_HOST_NOT_FOUND = 530;
210
210
  const ERR_ANO_PACKET = 531;
211
211
  const ERR_ANO_STATUS = 532;
212
212
  const ERR_ANO_NEGOTIATION = 533;
213
213
  const ERR_DATA_COMPRESSION = 534;
214
+ const ERR_CONFIG_PROVIDER_PARAM_TYPE = 535;
214
215
 
215
216
  // Oracle SUCCESS_WITH_INFO warning start from 700
216
217
  const WRN_COMPILATION_CREATE = 700;
@@ -228,11 +229,40 @@ adjustErrorXref.set("DPI-1080", ERR_CONNECTION_CLOSED);
228
229
  adjustErrorXref.set("OCI-22303", [ERR_INVALID_OBJECT_TYPE_NAME, 'type "([^"]*"."[^"]*)"']);
229
230
  adjustErrorXref.set("OCI-22164", ERR_DELETE_ELEMENTS_OF_VARRAY);
230
231
  adjustErrorXref.set("OCI-22165", [ERR_INVALID_COLL_INDEX_SET, /index \[([0-9]+)\] must be in the range of \[([0-9]+)\] to \[([0-9]+)\]/]);
232
+ adjustErrorXref.set("ORA-00022", ERR_CONNECTION_CLOSED);
231
233
  adjustErrorXref.set("ORA-00028", ERR_CONNECTION_CLOSED);
234
+ adjustErrorXref.set("ORA-00031", ERR_CONNECTION_CLOSED);
235
+ adjustErrorXref.set("ORA-00045", ERR_CONNECTION_CLOSED);
236
+ adjustErrorXref.set("ORA-00378", ERR_CONNECTION_CLOSED);
232
237
  adjustErrorXref.set("ORA-00600", ERR_CONNECTION_CLOSED);
238
+ adjustErrorXref.set("ORA-00602", ERR_CONNECTION_CLOSED);
239
+ adjustErrorXref.set("ORA-00603", ERR_CONNECTION_CLOSED);
240
+ adjustErrorXref.set("ORA-00609", ERR_CONNECTION_CLOSED);
241
+ adjustErrorXref.set("ORA-01012", ERR_CONNECTION_CLOSED);
242
+ adjustErrorXref.set("ORA-01041", ERR_CONNECTION_CLOSED);
243
+ adjustErrorXref.set("ORA-01043", ERR_CONNECTION_CLOSED);
244
+ adjustErrorXref.set("ORA-01089", ERR_CONNECTION_CLOSED);
245
+ adjustErrorXref.set("ORA-01092", ERR_CONNECTION_CLOSED);
246
+ adjustErrorXref.set("ORA-02396", ERR_CONNECTION_CLOSED);
247
+ adjustErrorXref.set("ORA-03113", ERR_CONNECTION_CLOSED);
248
+ adjustErrorXref.set("ORA-03114", ERR_CONNECTION_CLOSED);
249
+ adjustErrorXref.set("ORA-03122", ERR_CONNECTION_CLOSED);
250
+ adjustErrorXref.set("ORA-03135", ERR_CONNECTION_CLOSED);
251
+ adjustErrorXref.set("ORA-12153", ERR_CONNECTION_CLOSED);
252
+ adjustErrorXref.set("ORA-12537", ERR_CONNECTION_CLOSED);
253
+ adjustErrorXref.set("ORA-12547", ERR_CONNECTION_CLOSED);
254
+ adjustErrorXref.set("ORA-12570", ERR_CONNECTION_CLOSED);
255
+ adjustErrorXref.set("ORA-12583", ERR_CONNECTION_CLOSED);
256
+ adjustErrorXref.set("ORA-27146", ERR_CONNECTION_CLOSED);
257
+ adjustErrorXref.set("ORA-28511", ERR_CONNECTION_CLOSED);
258
+ adjustErrorXref.set("ORA-56600", ERR_CONNECTION_CLOSED);
233
259
  adjustErrorXref.set("ORA-24338", ERR_INVALID_REF_CURSOR);
234
260
  adjustErrorXref.set("ORA-25708", ERR_TOKEN_HAS_EXPIRED);
235
261
  adjustErrorXref.set("ORA-24344", WRN_COMPILATION_CREATE);
262
+ adjustErrorXref.set("ORA-26202", ERR_SESSIONLESS_INACTIVE);
263
+ adjustErrorXref.set("ORA-26211", ERR_SESSIONLESS_DIFFERING_METHODS);
264
+ adjustErrorXref.set("ORA-26216", ERR_SESSIONLESS_ALREADY_ACTIVE);
265
+ adjustErrorXref.set("DPI-1071", ERR_PAYLOAD_CANNOT_BE_ENQUEUED);
236
266
 
237
267
  // define mapping for error messages
238
268
  const messages = new Map();
@@ -247,7 +277,7 @@ messages.set(ERR_INVALID_PARAMETER_VALUE, // NJS-005
247
277
  messages.set(ERR_INVALID_PROPERTY_VALUE_IN_PARAM, // NJS-007
248
278
  'invalid value for "%s" in parameter %d');
249
279
  messages.set(ERR_INVALID_NUMBER_OF_PARAMETERS, // NJS-009
250
- 'invalid number of parameters');
280
+ 'invalid number of function parameters: %d provided but expected between %d and %d');
251
281
  // used in C -- keep synchronized!
252
282
  messages.set(ERR_UNSUPPORTED_DATA_TYPE, // NJS-010
253
283
  'unsupported data type %d in column %d');
@@ -371,9 +401,9 @@ messages.set(ERR_EXEC_MODE_ONLY_FOR_DML, // NJS-095
371
401
  messages.set(ERR_INVALID_BIND_NAME, // NJS-097
372
402
  'no bind placeholder named ":%s" was found in the statement text');
373
403
  messages.set(ERR_WRONG_NUMBER_OF_BINDS, // NJS-098
374
- '%s bind placeholders were used in the SQL statement but %s bind values were provided');
404
+ '%d bind placeholders were used in the SQL statement but %d bind values were provided');
375
405
  messages.set(ERR_BUFFER_LENGTH_INSUFFICIENT, // NJS-099
376
- 'internal error: buffer of length %s insufficient to hold %s bytes');
406
+ 'internal error: buffer of length %d insufficient to hold %d bytes');
377
407
  messages.set(ERR_NCHAR_CS_NOT_SUPPORTED, // NJS-100
378
408
  'national character set id %d is not supported by node-oracledb in Thin mode');
379
409
  messages.set(ERR_MISSING_CREDENTIALS, // NJS-101
@@ -473,7 +503,7 @@ messages.set(ERR_INVALID_TPC_END_FLAGS, // NJS-151
473
503
  messages.set(ERR_UNKNOWN_TRANSACTION_STATE, // NJS-152
474
504
  'internal error: unknown transaction state {state} in Two Phase Commit');
475
505
  messages.set(ERR_INVALID_TRANSACTION_SIZE, // NJS-153
476
- 'size of the transaction ID is %d and cannot exceed 64');
506
+ 'size of the transaction ID must be non-zero and must not exceed 64. Its current size is %d.');
477
507
  messages.set(ERR_INVALID_BRANCH_SIZE, // NJS-154
478
508
  'size of the branch ID is %d and cannot exceed 64');
479
509
  messages.set(ERR_OPERATION_NOT_SUPPORTED_ON_BFILE, // NJS-155
@@ -498,19 +528,30 @@ messages.set(ERR_VECTOR_SPARSE_INVALID_INPUT, // NJS-164
498
528
  'SPARSE VECTOR Invalid Input Data');
499
529
  messages.set(ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID, // NJS-165
500
530
  'SPARSE VECTOR indices element at index %d is not valid');
501
- messages.set(ERR_DB_FETCH_TYPE_HANDLER_CONVERTER, // NJS-166
531
+ messages.set(ERR_DB_FETCH_TYPE_HANDLER_CONVERTER, // NJS-166
502
532
  'DBFetchTypeHandler return value attribute "converter" must be a function');
503
- messages.set(ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE, // NJS-167
533
+ messages.set(ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE, // NJS-167
504
534
  'DBFetchTypeHandler return value must be an object');
505
535
  messages.set(ERR_ACCESS_TOKEN, // NJS-168
506
536
  'access token function failed.');
507
- messages.set(ERR_CALLOUT_FN, // NJS-169
537
+ messages.set(ERR_CALLOUT_FN, // NJS-169
508
538
  'External function call failed.');
539
+ messages.set(ERR_SESSIONLESS_DIFFERING_METHODS, //NJS-170
540
+ 'Different ways to start or suspend sessionless transactions are being used(server procedures and client APIs)');
541
+ messages.set(ERR_SESSIONLESS_ALREADY_ACTIVE, //NJS-171
542
+ 'Suspend, commit or rollback the currently active sessionless transaction before beginning or resuming another one.');
543
+ messages.set(ERR_SESSIONLESS_INACTIVE, //NJS-172
544
+ 'No sessionless transaction is active');
545
+ messages.set(ERR_INVALID_SERVER_RESPONSE, //NJS-173
546
+ 'Invalid server response to connection request');
547
+ messages.set(ERR_PAYLOAD_CANNOT_BE_ENQUEUED, // NJS-174
548
+ "Payload cannot be enqueued since it does not match the payload type supported by the queue");
549
+
509
550
 
510
551
  // Oracle Net layer errors
511
552
 
512
553
  messages.set(ERR_CONNECTION_CLOSED, // NJS-500
513
- 'connection to the Oracle Database was broken');
554
+ 'connection to Oracle Database was closed or broken');
514
555
  messages.set(ERR_CONNECTION_LOSTCONTACT, // NJS-501
515
556
  'connection to host %s port %d terminated unexpectedly. (CONNECTION_ID=%s)\n%s');
516
557
  messages.set(ERR_CONNECTION_INCOMPLETE, // NJS-503
@@ -551,20 +592,10 @@ messages.set(ERR_TNS_NAMES_FILE_MISSING, // NJS-520
551
592
  'cannot connect to Oracle Database. File tnsnames.ora not found in %s');
552
593
  messages.set(ERR_CONNECTION_EOF, // NJS-521
553
594
  'connection to host %s port %d received end-of-file on communication channel. (CONNECTION_ID=%s)');
554
- messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED, // NJS-522
555
- 'Azure Authentication Failed: The authentication parameter value %s may be incorrect');
556
595
  messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG, // NJS-523
557
596
  'Failed to retrieve configuration from Centralized Configuration Provider:\n %s');
558
- messages.set(ERR_CONFIG_PROVIDER_NOT_SUPPORTED, // NJS-524
559
- 'Configuration Provider not supported: %s');
560
- messages.set(ERR_CONFIG_PROVIDER_LOAD_FAILED, // NJS-525
561
- 'Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s');
562
- messages.set(ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED, // NJS-526
563
- 'OCI authentication failed: The authentication parameter value %s may be incorrect');
564
- messages.set(ERR_AZURE_VAULT_AUTH_FAILED, // NJS-527
565
- 'Azure Vault: Provide correct Azure Vault authentication details');
566
- messages.set(ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED, // NJS-528
567
- 'Azure service principal authentication requires either a client certificate path or a client secret string');
597
+ messages.set(ERR_REGISTER_HOOKFN_CONFIGPROVIDER, // NJS-524
598
+ '%s Configuration provider plugin not registered. Please register the hook function for the same');
568
599
  messages.set(ERR_WALLET_TYPE_NOT_SUPPORTED, // NJS-529
569
600
  'Invalid wallet content format. Supported format is PEM');
570
601
  messages.set(ERR_HOST_NOT_FOUND, // NJS-530
@@ -577,6 +608,8 @@ messages.set(ERR_ANO_NEGOTIATION, // NJS-533
577
608
  'Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.\nCause: ORA-%s');
578
609
  messages.set(ERR_DATA_COMPRESSION, 'Error during data compression/decompression: %s\n'); //NJS-534
579
610
  // Oracle SUCCESS_WITH_INFO warning
611
+ messages.set(ERR_CONFIG_PROVIDER_PARAM_TYPE, // NJS-535
612
+ 'Parameter does not have a valid type: %s\n');
580
613
  messages.set(WRN_COMPILATION_CREATE, // NJS-700
581
614
  'creation succeeded with compilation errors');
582
615
 
@@ -601,7 +634,7 @@ function assert(condition) {
601
634
  //-----------------------------------------------------------------------------
602
635
  function assertArgCount(args, minArgCount, maxArgCount) {
603
636
  assert(args.length >= minArgCount && args.length <= maxArgCount,
604
- ERR_INVALID_NUMBER_OF_PARAMETERS);
637
+ ERR_INVALID_NUMBER_OF_PARAMETERS, args.length, minArgCount, maxArgCount);
605
638
  }
606
639
 
607
640
  //-----------------------------------------------------------------------------
@@ -645,8 +678,8 @@ function assertParamPropInt(obj, parameterNum, propName) {
645
678
  //-----------------------------------------------------------------------------
646
679
  // assertParamPropUnsignedInt()
647
680
  //
648
- // Asserts that the property value of a parameter is a positive integer value
649
- // (or undefined).
681
+ // Asserts that the property value of a parameter is a non-negative integer
682
+ // value (or undefined).
650
683
  //-----------------------------------------------------------------------------
651
684
  function assertParamPropUnsignedInt(obj, parameterNum, propName) {
652
685
  if (obj[propName] !== undefined) {
@@ -728,6 +761,7 @@ function getErr(errorNum) {
728
761
  args[0] = `${code}: ${baseText}`;
729
762
  const err = new Error(util.format(...args));
730
763
  err.code = code;
764
+ err.isRecoverable = (errorNum === ERR_CONNECTION_CLOSED);
731
765
  Error.captureStackTrace(err, getErr);
732
766
  return err;
733
767
  }
@@ -904,13 +938,9 @@ module.exports = {
904
938
  ERR_NO_CONFIG_DIR,
905
939
  ERR_TNS_ENTRY_NOT_FOUND,
906
940
  ERR_CONNECTION_EOF,
907
- ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED,
908
- ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED,
909
- ERR_AZURE_VAULT_AUTH_FAILED,
910
- ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED,
911
941
  ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
912
- ERR_CONFIG_PROVIDER_NOT_SUPPORTED,
913
- ERR_CONFIG_PROVIDER_LOAD_FAILED,
942
+ ERR_CONFIG_PROVIDER_PARAM_TYPE,
943
+ ERR_REGISTER_HOOKFN_CONFIGPROVIDER,
914
944
  ERR_DATA_COMPRESSION,
915
945
  ERR_WALLET_TYPE_NOT_SUPPORTED,
916
946
  ERR_HOST_NOT_FOUND,
@@ -974,6 +1004,11 @@ module.exports = {
974
1004
  ERR_UNKNOWN_TRANSACTION_STATE,
975
1005
  ERR_INVALID_TRANSACTION_SIZE,
976
1006
  ERR_INVALID_BRANCH_SIZE,
1007
+ ERR_SESSIONLESS_DIFFERING_METHODS,
1008
+ ERR_SESSIONLESS_ALREADY_ACTIVE,
1009
+ ERR_SESSIONLESS_INACTIVE,
1010
+ ERR_INVALID_SERVER_RESPONSE,
1011
+ ERR_PAYLOAD_CANNOT_BE_ENQUEUED,
977
1012
  ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
978
1013
  ERR_OPERATION_NOT_SUPPORTED_ON_BFILE,
979
1014
  ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE,
@@ -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
  //
@@ -289,6 +289,15 @@ class ConnectionImpl {
289
289
  errors.throwNotImplemented("getting the internal name");
290
290
  }
291
291
 
292
+ //---------------------------------------------------------------------------
293
+ // getLTXID()
294
+ //
295
+ // Returns the the logical transaction ID for database transactions.
296
+ //---------------------------------------------------------------------------
297
+ getLTXID() {
298
+ errors.throwNotImplemented("getting the logical transaction id");
299
+ }
300
+
292
301
  //---------------------------------------------------------------------------
293
302
  // getMaxIdentifierLength()
294
303
  //
@@ -397,6 +397,18 @@ class BaseBuffer {
397
397
  return buf;
398
398
  }
399
399
 
400
+ //---------------------------------------------------------------------------
401
+ // readBytesAndLength()
402
+ //
403
+ // Reads the UB4 length from the buffer and then returns a Buffer containing
404
+ // the specified number of bytes.
405
+ //---------------------------------------------------------------------------
406
+ readBytesAndLength() {
407
+ const numBytes = this.readUB4();
408
+ if (numBytes > 0)
409
+ return this.readBytesWithLength();
410
+ }
411
+
400
412
  //---------------------------------------------------------------------------
401
413
  // readBytesWithLength()
402
414
  //
@@ -548,6 +560,17 @@ class BaseBuffer {
548
560
  return Buffer.from(buf).swap16().toString('utf16le');
549
561
  }
550
562
 
563
+ //---------------------------------------------------------------------------
564
+ // readStrAndLength()
565
+ //
566
+ // Reads a length from the buffer and then, if the length is non-zero, reads
567
+ // string from the buffer and returns it.
568
+ //---------------------------------------------------------------------------
569
+ readStrAndLength() {
570
+ const buf = this.readBytesAndLength();
571
+ return buf ? buf.toString() : null;
572
+ }
573
+
551
574
  //---------------------------------------------------------------------------
552
575
  // readUB2()
553
576
  //
@@ -997,6 +1020,32 @@ class BaseBuffer {
997
1020
  this.buf.writeInt32BE(n, pos);
998
1021
  }
999
1022
 
1023
+ //---------------------------------------------------------------------------
1024
+ // writeSB4()
1025
+ //
1026
+ // Writes a signed integer (up to 4 bytes in length) in variable length
1027
+ // format to the buffer.
1028
+ //---------------------------------------------------------------------------
1029
+ writeSB4(value) {
1030
+ let sign = 0;
1031
+ if (value < 0) {
1032
+ value = -value;
1033
+ sign = 0x80;
1034
+ }
1035
+ if (value === 0) {
1036
+ this.writeUInt8(0);
1037
+ } else if (value <= 0xff) {
1038
+ this.writeUInt8(1 | sign);
1039
+ this.writeUInt8(value);
1040
+ } else if (value <= 0xffff) {
1041
+ this.writeUInt8(2 | sign);
1042
+ this.writeUInt16BE(value);
1043
+ } else {
1044
+ this.writeUInt8(4 | sign);
1045
+ this.writeUInt32BE(value);
1046
+ }
1047
+ }
1048
+
1000
1049
  //---------------------------------------------------------------------------
1001
1050
  // writeUB4()
1002
1051
  //
@@ -549,8 +549,13 @@ class OsonTreeSegment extends GrowableBuffer {
549
549
 
550
550
  // handle numbers
551
551
  } else if (typeof value === 'number') {
552
- this.writeUInt8(constants.TNS_JSON_TYPE_NUMBER_LENGTH_UINT8);
553
- this.writeOracleNumber(value.toString());
552
+ if (Number.isNaN(value)) {
553
+ this.writeUInt8(constants.TNS_JSON_TYPE_BINARY_DOUBLE);
554
+ this.writeBinaryDouble(value);
555
+ } else {
556
+ this.writeUInt8(constants.TNS_JSON_TYPE_NUMBER_LENGTH_UINT8);
557
+ this.writeOracleNumber(value.toString());
558
+ }
554
559
 
555
560
  // handle strings
556
561
  } else if (typeof value === 'string') {
package/lib/impl/pool.js CHANGED
@@ -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
  //
@@ -165,6 +165,15 @@ class PoolImpl {
165
165
  errors.throwNotImplemented("getting the pool timeout");
166
166
  }
167
167
 
168
+ //---------------------------------------------------------------------------
169
+ // getMaxLifetimeSession()
170
+ //
171
+ // Returns the pool max lifetime for a session.
172
+ //---------------------------------------------------------------------------
173
+ getMaxLifetimeSession() {
174
+ errors.throwNotImplemented("getting the pool max lifetime");
175
+ }
176
+
168
177
  //---------------------------------------------------------------------------
169
178
  // getStmtCacheSize()
170
179
  //
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -43,8 +43,9 @@ class ResultSetImpl extends BaseImpl {
43
43
  // _determineFetchType()
44
44
  //
45
45
  // Determine the fetch type to use for the specified metadata.
46
+ // Param rowsetMetaData includes metadata of all the columns fetched.
46
47
  //---------------------------------------------------------------------------
47
- _determineFetchType(metadata, options) {
48
+ _determineFetchType(metadata, options, rowsetMetaData) {
48
49
 
49
50
  // clear any previous fetch type and converter functions that may have been
50
51
  // retained
@@ -54,7 +55,7 @@ class ResultSetImpl extends BaseImpl {
54
55
  // if a fetch type handler is specified, call it; if no value (undefined)
55
56
  // is returned, the normal processing takes place
56
57
  if (options.fetchTypeHandler) {
57
- const result = options.fetchTypeHandler(metadata);
58
+ const result = options.fetchTypeHandler(metadata, rowsetMetaData);
58
59
  if (result !== undefined) {
59
60
  errors.assert(typeof result === 'object',
60
61
  errors.ERR_FETCH_TYPE_HANDLER_RETURN_VALUE);
@@ -232,7 +233,7 @@ class ResultSetImpl extends BaseImpl {
232
233
  info.dbTypeClass = cls;
233
234
  }
234
235
  nodbUtil.addTypeProperties(info, "dbType");
235
- this._determineFetchType(info, options);
236
+ this._determineFetchType(info, options, metaData);
236
237
  if (info.fetchType === types.DB_TYPE_CURSOR) {
237
238
  this.nestedCursorIndices.push(i);
238
239
  } else if (info.fetchType === types.DB_TYPE_CLOB ||
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2023, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -31,21 +31,12 @@ const errors = require('../errors.js');
31
31
  class SodaDocumentImpl {
32
32
 
33
33
  //---------------------------------------------------------------------------
34
- // getContentAsBuffer()
34
+ // getContent()
35
35
  //
36
- // Returns the document content as a Buffer object.
36
+ // Returns the document content.
37
37
  //---------------------------------------------------------------------------
38
- getContentAsBuffer() {
39
- errors.throwNotImplemented("getting doc content as a buffer");
40
- }
41
-
42
- //---------------------------------------------------------------------------
43
- // getContentAsString()
44
- //
45
- // Returns the document content as a string.
46
- //---------------------------------------------------------------------------
47
- getContentAsString() {
48
- errors.throwNotImplemented("getting doc content as a string");
38
+ getContent() {
39
+ errors.throwNotImplemented("getting doc content");
49
40
  }
50
41
 
51
42
  //---------------------------------------------------------------------------
package/lib/lob.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2016, 2024, Oracle and/or its affiliates.
1
+ // Copyright (c) 2016, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -246,6 +246,14 @@ class Lob extends Duplex {
246
246
  this._checkIsBfile();
247
247
  errors.assertArgCount(arguments, 1, 1);
248
248
  errors.assertParamValue(nodbUtil.isObject(a1), 1);
249
+ errors.assertParamValue(Object.hasOwn(a1, "dirName"), 1);
250
+ errors.assertParamValue(Object.hasOwn(a1, "fileName"), 1);
251
+ errors.assertPropValue(
252
+ a1.dirName != "" && a1.dirName != null, "dirName"
253
+ );
254
+ errors.assertPropValue(
255
+ a1.fileName != "" && a1.fileName != null, "fileName"
256
+ );
249
257
  this._impl.setDirFileName(a1);
250
258
  }
251
259