oracledb 6.7.2 → 6.9.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.
- package/LICENSE.txt +1 -1
- package/NOTICE.txt +1 -1
- package/README.md +39 -3
- package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.9.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +1 -0
- package/lib/aqMessage.js +10 -1
- package/lib/configProviders/file.js +72 -0
- package/lib/connection.js +153 -4
- package/lib/dbObject.js +51 -10
- package/lib/errors.js +144 -36
- package/lib/impl/connection.js +24 -1
- package/lib/impl/datahandlers/buffer.js +92 -1
- package/lib/impl/datahandlers/constants.js +2 -0
- package/lib/impl/datahandlers/oson.js +15 -1
- package/lib/impl/datahandlers/vector.js +72 -27
- package/lib/impl/pool.js +10 -1
- package/lib/impl/resultset.js +5 -4
- package/lib/lob.js +9 -1
- package/lib/oracledb.js +209 -20
- package/lib/pool.js +12 -1
- package/lib/poolStatistics.js +3 -1
- package/lib/settings.js +5 -1
- package/lib/thin/connection.js +130 -12
- package/lib/thin/dbObject.js +46 -13
- package/lib/thin/lob.js +2 -3
- package/lib/thin/pool.js +112 -31
- package/lib/thin/protocol/capabilities.js +8 -4
- package/lib/thin/protocol/constants.js +31 -1
- package/lib/thin/protocol/messages/auth.js +42 -6
- package/lib/thin/protocol/messages/base.js +98 -9
- package/lib/thin/protocol/messages/dataType.js +2 -1
- package/lib/thin/protocol/messages/execute.js +46 -4
- package/lib/thin/protocol/messages/fastAuth.js +6 -1
- package/lib/thin/protocol/messages/lobOp.js +5 -22
- package/lib/thin/protocol/messages/logOff.js +0 -1
- package/lib/thin/protocol/messages/sessionRelease.js +0 -1
- package/lib/thin/protocol/messages/transactionSwitch.js +12 -4
- package/lib/thin/protocol/messages/withData.js +10 -1
- package/lib/thin/protocol/packet.js +1 -1
- package/lib/thin/protocol/protocol.js +2 -1
- package/lib/thin/sqlnet/ANO.js +438 -0
- package/lib/thin/sqlnet/connStrategy.js +2 -1
- package/lib/thin/sqlnet/constants.js +5 -1
- package/lib/thin/sqlnet/ezConnectResolver.js +4 -2
- package/lib/thin/sqlnet/navNodes.js +22 -3
- package/lib/thin/sqlnet/networkSession.js +94 -16
- package/lib/thin/sqlnet/ntTcp.js +50 -3
- package/lib/thin/sqlnet/packet.js +32 -4
- package/lib/thin/sqlnet/sessionAtts.js +24 -2
- package/lib/thin/util.js +3 -8
- package/lib/transformer.js +13 -2
- package/lib/types.js +220 -8
- package/lib/util.js +77 -3
- package/lib/version.js +2 -2
- package/package/install.js +3 -3
- package/package/prunebinaries.js +6 -12
- package/package.json +2 -2
- package/{lib/configProviders/azure.js → plugins/configProviders/azure/index.js} +70 -63
- package/plugins/configProviders/azurevault/index.js +84 -0
- package/{lib → plugins}/configProviders/base.js +13 -3
- package/{lib/configProviders/ociobject.js → plugins/configProviders/ociobject/index.js} +43 -78
- package/plugins/configProviders/ocivault/index.js +100 -0
- package/plugins/token/extensionAzure/index.js +101 -0
- package/plugins/token/extensionOci/index.js +210 -0
- package/build/Release/oracledb-6.7.2-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.7.2-darwin-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.7.2-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.7.2-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.7.2-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.7.2-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.7.2-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.7.2-linux-x64.node +0 -0
- package/build/Release/oracledb-6.7.2-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.7.2-win32-x64.node +0 -0
- package/build/Release/oracledb-6.7.2-win32-x64.node-buildinfo.txt +0 -1
package/lib/errors.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
// Copyright (c) 2022,
|
|
2
|
-
|
|
1
|
+
// Copyright (c) 2022, 2025, Oracle and/or its affiliates.
|
|
3
2
|
//-----------------------------------------------------------------------------
|
|
4
3
|
//
|
|
5
4
|
// This software is dual-licensed to you under the Universal Permissive License
|
|
@@ -164,6 +163,21 @@ const ERR_INVALID_BRANCH_SIZE = 154;
|
|
|
164
163
|
const ERR_OPERATION_NOT_SUPPORTED_ON_BFILE = 155;
|
|
165
164
|
const ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE = 156;
|
|
166
165
|
const ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES = 157;
|
|
166
|
+
const ERR_VECTOR_SPARSE_INDICES_IS_NOT_ARRAY = 158;
|
|
167
|
+
const ERR_VECTOR_SPARSE_VALUES_IS_NOT_ARRAY = 159;
|
|
168
|
+
const ERR_VECTOR_SPARSE_DIMS_IS_NOT_INTEGER = 160;
|
|
169
|
+
const ERR_VECTOR_SPARSE_INDICES_VALUES_NOT_EQUAL = 161;
|
|
170
|
+
const ERR_VECTOR_SPARSE_INVALID_JSON = 162;
|
|
171
|
+
const ERR_VECTOR_SPARSE_INVALID_STRING = 163;
|
|
172
|
+
const ERR_VECTOR_SPARSE_INVALID_INPUT = 164;
|
|
173
|
+
const ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID = 165;
|
|
174
|
+
const ERR_DB_FETCH_TYPE_HANDLER_CONVERTER = 166;
|
|
175
|
+
const ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE = 167;
|
|
176
|
+
const ERR_ACCESS_TOKEN = 168;
|
|
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;
|
|
167
181
|
|
|
168
182
|
// Oracle Net layer errors start from 500
|
|
169
183
|
const ERR_CONNECTION_CLOSED = 500;
|
|
@@ -187,15 +201,15 @@ const ERR_INVALID_SERVICE_NAME = 518;
|
|
|
187
201
|
const ERR_INVALID_SID = 519;
|
|
188
202
|
const ERR_TNS_NAMES_FILE_MISSING = 520;
|
|
189
203
|
const ERR_CONNECTION_EOF = 521;
|
|
190
|
-
const ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED = 522;
|
|
191
204
|
const ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG = 523;
|
|
192
|
-
const
|
|
193
|
-
const ERR_CONFIG_PROVIDER_LOAD_FAILED = 525;
|
|
194
|
-
const ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED = 526;
|
|
195
|
-
const ERR_AZURE_VAULT_AUTH_FAILED = 527;
|
|
196
|
-
const ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED = 528;
|
|
205
|
+
const ERR_REGISTER_HOOKFN_CONFIGPROVIDER = 524;
|
|
197
206
|
const ERR_WALLET_TYPE_NOT_SUPPORTED = 529;
|
|
198
207
|
const ERR_HOST_NOT_FOUND = 530;
|
|
208
|
+
const ERR_ANO_PACKET = 531;
|
|
209
|
+
const ERR_ANO_STATUS = 532;
|
|
210
|
+
const ERR_ANO_NEGOTIATION = 533;
|
|
211
|
+
const ERR_DATA_COMPRESSION = 534;
|
|
212
|
+
const ERR_CONFIG_PROVIDER_PARAM_TYPE = 535;
|
|
199
213
|
|
|
200
214
|
// Oracle SUCCESS_WITH_INFO warning start from 700
|
|
201
215
|
const WRN_COMPILATION_CREATE = 700;
|
|
@@ -213,11 +227,39 @@ adjustErrorXref.set("DPI-1080", ERR_CONNECTION_CLOSED);
|
|
|
213
227
|
adjustErrorXref.set("OCI-22303", [ERR_INVALID_OBJECT_TYPE_NAME, 'type "([^"]*"."[^"]*)"']);
|
|
214
228
|
adjustErrorXref.set("OCI-22164", ERR_DELETE_ELEMENTS_OF_VARRAY);
|
|
215
229
|
adjustErrorXref.set("OCI-22165", [ERR_INVALID_COLL_INDEX_SET, /index \[([0-9]+)\] must be in the range of \[([0-9]+)\] to \[([0-9]+)\]/]);
|
|
230
|
+
adjustErrorXref.set("ORA-00022", ERR_CONNECTION_CLOSED);
|
|
216
231
|
adjustErrorXref.set("ORA-00028", ERR_CONNECTION_CLOSED);
|
|
232
|
+
adjustErrorXref.set("ORA-00031", ERR_CONNECTION_CLOSED);
|
|
233
|
+
adjustErrorXref.set("ORA-00045", ERR_CONNECTION_CLOSED);
|
|
234
|
+
adjustErrorXref.set("ORA-00378", ERR_CONNECTION_CLOSED);
|
|
217
235
|
adjustErrorXref.set("ORA-00600", ERR_CONNECTION_CLOSED);
|
|
236
|
+
adjustErrorXref.set("ORA-00602", ERR_CONNECTION_CLOSED);
|
|
237
|
+
adjustErrorXref.set("ORA-00603", ERR_CONNECTION_CLOSED);
|
|
238
|
+
adjustErrorXref.set("ORA-00609", ERR_CONNECTION_CLOSED);
|
|
239
|
+
adjustErrorXref.set("ORA-01012", ERR_CONNECTION_CLOSED);
|
|
240
|
+
adjustErrorXref.set("ORA-01041", ERR_CONNECTION_CLOSED);
|
|
241
|
+
adjustErrorXref.set("ORA-01043", ERR_CONNECTION_CLOSED);
|
|
242
|
+
adjustErrorXref.set("ORA-01089", ERR_CONNECTION_CLOSED);
|
|
243
|
+
adjustErrorXref.set("ORA-01092", ERR_CONNECTION_CLOSED);
|
|
244
|
+
adjustErrorXref.set("ORA-02396", ERR_CONNECTION_CLOSED);
|
|
245
|
+
adjustErrorXref.set("ORA-03113", ERR_CONNECTION_CLOSED);
|
|
246
|
+
adjustErrorXref.set("ORA-03114", ERR_CONNECTION_CLOSED);
|
|
247
|
+
adjustErrorXref.set("ORA-03122", ERR_CONNECTION_CLOSED);
|
|
248
|
+
adjustErrorXref.set("ORA-03135", ERR_CONNECTION_CLOSED);
|
|
249
|
+
adjustErrorXref.set("ORA-12153", ERR_CONNECTION_CLOSED);
|
|
250
|
+
adjustErrorXref.set("ORA-12537", ERR_CONNECTION_CLOSED);
|
|
251
|
+
adjustErrorXref.set("ORA-12547", ERR_CONNECTION_CLOSED);
|
|
252
|
+
adjustErrorXref.set("ORA-12570", ERR_CONNECTION_CLOSED);
|
|
253
|
+
adjustErrorXref.set("ORA-12583", ERR_CONNECTION_CLOSED);
|
|
254
|
+
adjustErrorXref.set("ORA-27146", ERR_CONNECTION_CLOSED);
|
|
255
|
+
adjustErrorXref.set("ORA-28511", ERR_CONNECTION_CLOSED);
|
|
256
|
+
adjustErrorXref.set("ORA-56600", ERR_CONNECTION_CLOSED);
|
|
218
257
|
adjustErrorXref.set("ORA-24338", ERR_INVALID_REF_CURSOR);
|
|
219
258
|
adjustErrorXref.set("ORA-25708", ERR_TOKEN_HAS_EXPIRED);
|
|
220
259
|
adjustErrorXref.set("ORA-24344", WRN_COMPILATION_CREATE);
|
|
260
|
+
adjustErrorXref.set("ORA-26202", ERR_SESSIONLESS_INACTIVE);
|
|
261
|
+
adjustErrorXref.set("ORA-26211", ERR_SESSIONLESS_DIFFERING_METHODS);
|
|
262
|
+
adjustErrorXref.set("ORA-26216", ERR_SESSIONLESS_ALREADY_ACTIVE);
|
|
221
263
|
|
|
222
264
|
// define mapping for error messages
|
|
223
265
|
const messages = new Map();
|
|
@@ -232,7 +274,7 @@ messages.set(ERR_INVALID_PARAMETER_VALUE, // NJS-005
|
|
|
232
274
|
messages.set(ERR_INVALID_PROPERTY_VALUE_IN_PARAM, // NJS-007
|
|
233
275
|
'invalid value for "%s" in parameter %d');
|
|
234
276
|
messages.set(ERR_INVALID_NUMBER_OF_PARAMETERS, // NJS-009
|
|
235
|
-
'invalid number of parameters');
|
|
277
|
+
'invalid number of function parameters: %d provided but expected between %d and %d');
|
|
236
278
|
// used in C -- keep synchronized!
|
|
237
279
|
messages.set(ERR_UNSUPPORTED_DATA_TYPE, // NJS-010
|
|
238
280
|
'unsupported data type %d in column %d');
|
|
@@ -416,7 +458,7 @@ messages.set(ERR_INVALID_OBJECT_TYPE_NAME, // NJS-129
|
|
|
416
458
|
messages.set(ERR_TDS_TYPE_NOT_SUPPORTED, // NJS-130
|
|
417
459
|
'Oracle TDS data type %d is not supported');
|
|
418
460
|
messages.set(ERR_INVALID_COLL_INDEX_SET, // NJS-131
|
|
419
|
-
'given index %d must be in the range of %d to %d');
|
|
461
|
+
'given index [%d] must be in the range of [%d] to [%d]');
|
|
420
462
|
messages.set(ERR_INVALID_COLL_INDEX_GET, // NJS-132
|
|
421
463
|
'element at index %d does not exist');
|
|
422
464
|
messages.set(ERR_DELETE_ELEMENTS_OF_VARRAY, // NJS-133
|
|
@@ -458,7 +500,7 @@ messages.set(ERR_INVALID_TPC_END_FLAGS, // NJS-151
|
|
|
458
500
|
messages.set(ERR_UNKNOWN_TRANSACTION_STATE, // NJS-152
|
|
459
501
|
'internal error: unknown transaction state {state} in Two Phase Commit');
|
|
460
502
|
messages.set(ERR_INVALID_TRANSACTION_SIZE, // NJS-153
|
|
461
|
-
'size of the transaction ID
|
|
503
|
+
'size of the transaction ID must be non-zero and must not exceed 64. Its current size is %d.');
|
|
462
504
|
messages.set(ERR_INVALID_BRANCH_SIZE, // NJS-154
|
|
463
505
|
'size of the branch ID is %d and cannot exceed 64');
|
|
464
506
|
messages.set(ERR_OPERATION_NOT_SUPPORTED_ON_BFILE, // NJS-155
|
|
@@ -467,11 +509,41 @@ messages.set(ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE, // NJS-156
|
|
|
467
509
|
'operation is only supported on BFILE LOBs');
|
|
468
510
|
messages.set(ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES, // NJS-157
|
|
469
511
|
'executeMany() cannot be used with SELECT statement or WITH SQL clause');
|
|
512
|
+
messages.set(ERR_VECTOR_SPARSE_INDICES_IS_NOT_ARRAY, // NJS-158
|
|
513
|
+
'SPARSE VECTOR indices is not Uint32Array or an Array');
|
|
514
|
+
messages.set(ERR_VECTOR_SPARSE_VALUES_IS_NOT_ARRAY, // NJS-159
|
|
515
|
+
'SPARSE VECTOR values is not an Array');
|
|
516
|
+
messages.set(ERR_VECTOR_SPARSE_DIMS_IS_NOT_INTEGER, // NJS-160
|
|
517
|
+
'SPARSE VECTOR dimensions is not an Positive Integer');
|
|
518
|
+
messages.set(ERR_VECTOR_SPARSE_INDICES_VALUES_NOT_EQUAL, // NJS-161
|
|
519
|
+
'SPARSE VECTOR indices and values must be of same length');
|
|
520
|
+
messages.set(ERR_VECTOR_SPARSE_INVALID_JSON, // NJS-162
|
|
521
|
+
'SPARSE VECTOR string data is not valid JSON');
|
|
522
|
+
messages.set(ERR_VECTOR_SPARSE_INVALID_STRING, // NJS-163
|
|
523
|
+
'SPARSE VECTOR string data Array should have exactly 3 elements');
|
|
524
|
+
messages.set(ERR_VECTOR_SPARSE_INVALID_INPUT, // NJS-164
|
|
525
|
+
'SPARSE VECTOR Invalid Input Data');
|
|
526
|
+
messages.set(ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID, // NJS-165
|
|
527
|
+
'SPARSE VECTOR indices element at index %d is not valid');
|
|
528
|
+
messages.set(ERR_DB_FETCH_TYPE_HANDLER_CONVERTER, // NJS-166
|
|
529
|
+
'DBFetchTypeHandler return value attribute "converter" must be a function');
|
|
530
|
+
messages.set(ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE, // NJS-167
|
|
531
|
+
'DBFetchTypeHandler return value must be an object');
|
|
532
|
+
messages.set(ERR_ACCESS_TOKEN, // NJS-168
|
|
533
|
+
'access token function failed.');
|
|
534
|
+
messages.set(ERR_CALLOUT_FN, // NJS-169
|
|
535
|
+
'External function call failed.');
|
|
536
|
+
messages.set(ERR_SESSIONLESS_DIFFERING_METHODS, //NJS-170
|
|
537
|
+
'Different ways to start or suspend sessionless transactions are being used(server procedures and client APIs)');
|
|
538
|
+
messages.set(ERR_SESSIONLESS_ALREADY_ACTIVE, //NJS-171
|
|
539
|
+
'Suspend, commit or rollback the currently active sessionless transaction before beginning or resuming another one.');
|
|
540
|
+
messages.set(ERR_SESSIONLESS_INACTIVE, //NJS-172
|
|
541
|
+
'No sessionless transaction is active');
|
|
470
542
|
|
|
471
543
|
// Oracle Net layer errors
|
|
472
544
|
|
|
473
545
|
messages.set(ERR_CONNECTION_CLOSED, // NJS-500
|
|
474
|
-
'connection to
|
|
546
|
+
'connection to Oracle Database was closed or broken');
|
|
475
547
|
messages.set(ERR_CONNECTION_LOSTCONTACT, // NJS-501
|
|
476
548
|
'connection to host %s port %d terminated unexpectedly. (CONNECTION_ID=%s)\n%s');
|
|
477
549
|
messages.set(ERR_CONNECTION_INCOMPLETE, // NJS-503
|
|
@@ -512,27 +584,25 @@ messages.set(ERR_TNS_NAMES_FILE_MISSING, // NJS-520
|
|
|
512
584
|
'cannot connect to Oracle Database. File tnsnames.ora not found in %s');
|
|
513
585
|
messages.set(ERR_CONNECTION_EOF, // NJS-521
|
|
514
586
|
'connection to host %s port %d received end-of-file on communication channel. (CONNECTION_ID=%s)');
|
|
515
|
-
messages.set(ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED, // NJS-522
|
|
516
|
-
'Azure Authentication Failed: The authentication parameter value %s may be incorrect');
|
|
517
587
|
messages.set(ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG, // NJS-523
|
|
518
588
|
'Failed to retrieve configuration from Centralized Configuration Provider:\n %s');
|
|
519
|
-
messages.set(
|
|
520
|
-
'Configuration
|
|
521
|
-
messages.set(
|
|
522
|
-
'Centralized Config Provider failed to load required libraries. Please install the required libraries.\n %s');
|
|
523
|
-
messages.set(ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED, // NJS-526
|
|
524
|
-
'OCI authentication failed: The authentication parameter value %s may be incorrect');
|
|
525
|
-
messages.set(ERR_AZURE_VAULT_AUTH_FAILED, // NJS-527
|
|
526
|
-
'Azure Vault: Provide correct Azure Vault authentication details');
|
|
527
|
-
messages.set(ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED, // NJS-528
|
|
528
|
-
'Azure service principal authentication requires either a client certificate path or a client secret string');
|
|
529
|
-
messages.set(ERR_WALLET_TYPE_NOT_SUPPORTED, // NJS-529
|
|
589
|
+
messages.set(ERR_REGISTER_HOOKFN_CONFIGPROVIDER, // NJS-524
|
|
590
|
+
'%s Configuration provider plugin not registered. Please register the hook function for the same');
|
|
591
|
+
messages.set(ERR_WALLET_TYPE_NOT_SUPPORTED, // NJS-529
|
|
530
592
|
'Invalid wallet content format. Supported format is PEM');
|
|
531
|
-
messages.set(ERR_HOST_NOT_FOUND,
|
|
593
|
+
messages.set(ERR_HOST_NOT_FOUND, // NJS-530
|
|
532
594
|
'The host addresses or URLs provided by the connect string are incorrect or unresolvable in your network.');
|
|
533
|
-
|
|
595
|
+
messages.set(ERR_ANO_PACKET, // NJS-531
|
|
596
|
+
'Error in Advanced Networking Option packet received from the server');
|
|
597
|
+
messages.set(ERR_ANO_STATUS, // NJS-532
|
|
598
|
+
'%s service recieved status failure');
|
|
599
|
+
messages.set(ERR_ANO_NEGOTIATION, // NJS-533
|
|
600
|
+
'Advanced Networking Option service negotiation failed. Native Network Encryption and DataIntegrity only supported in node-oracledb thick mode.\nCause: ORA-%s');
|
|
601
|
+
messages.set(ERR_DATA_COMPRESSION, 'Error during data compression/decompression: %s\n'); //NJS-534
|
|
534
602
|
// Oracle SUCCESS_WITH_INFO warning
|
|
535
|
-
messages.set(
|
|
603
|
+
messages.set(ERR_CONFIG_PROVIDER_PARAM_TYPE, // NJS-535
|
|
604
|
+
'Parameter does not have a valid type: %s\n');
|
|
605
|
+
messages.set(WRN_COMPILATION_CREATE, // NJS-700
|
|
536
606
|
'creation succeeded with compilation errors');
|
|
537
607
|
|
|
538
608
|
//-----------------------------------------------------------------------------
|
|
@@ -556,7 +626,7 @@ function assert(condition) {
|
|
|
556
626
|
//-----------------------------------------------------------------------------
|
|
557
627
|
function assertArgCount(args, minArgCount, maxArgCount) {
|
|
558
628
|
assert(args.length >= minArgCount && args.length <= maxArgCount,
|
|
559
|
-
ERR_INVALID_NUMBER_OF_PARAMETERS);
|
|
629
|
+
ERR_INVALID_NUMBER_OF_PARAMETERS, args.length, minArgCount, maxArgCount);
|
|
560
630
|
}
|
|
561
631
|
|
|
562
632
|
//-----------------------------------------------------------------------------
|
|
@@ -683,6 +753,7 @@ function getErr(errorNum) {
|
|
|
683
753
|
args[0] = `${code}: ${baseText}`;
|
|
684
754
|
const err = new Error(util.format(...args));
|
|
685
755
|
err.code = code;
|
|
756
|
+
err.isRecoverable = (errorNum === ERR_CONNECTION_CLOSED);
|
|
686
757
|
Error.captureStackTrace(err, getErr);
|
|
687
758
|
return err;
|
|
688
759
|
}
|
|
@@ -697,6 +768,14 @@ function throwErr() {
|
|
|
697
768
|
throw (getErr(...arguments));
|
|
698
769
|
}
|
|
699
770
|
|
|
771
|
+
function throwErrWithORAError() {
|
|
772
|
+
const err = (getErr(...arguments));
|
|
773
|
+
const pos = err.message.indexOf("ORA-");
|
|
774
|
+
const oraError = err.message.substring(pos + 4, pos + 9);
|
|
775
|
+
err.message = err.message + '\nHelp: https://docs.oracle.com/error-help/db/ora-' + oraError;
|
|
776
|
+
throw err;
|
|
777
|
+
}
|
|
778
|
+
|
|
700
779
|
//-----------------------------------------------------------------------------
|
|
701
780
|
// throwNotImplemented()
|
|
702
781
|
//
|
|
@@ -706,6 +785,7 @@ function throwNotImplemented(feature) {
|
|
|
706
785
|
throwErr(ERR_NOT_IMPLEMENTED, feature);
|
|
707
786
|
}
|
|
708
787
|
|
|
788
|
+
|
|
709
789
|
//-----------------------------------------------------------------------------
|
|
710
790
|
// transformErr()
|
|
711
791
|
//
|
|
@@ -754,6 +834,17 @@ function transformErr(err, fnOpt) {
|
|
|
754
834
|
return err;
|
|
755
835
|
}
|
|
756
836
|
|
|
837
|
+
//-----------------------------------------------------------------------------
|
|
838
|
+
// throwWrapErr()
|
|
839
|
+
//
|
|
840
|
+
// Throws error by wrapping exceptions with a specific error.
|
|
841
|
+
//-----------------------------------------------------------------------------
|
|
842
|
+
function throwWrapErr(err, fnOpt) {
|
|
843
|
+
const newErr = getErr(fnOpt);
|
|
844
|
+
newErr.stack = err.stack;
|
|
845
|
+
throw newErr;
|
|
846
|
+
}
|
|
847
|
+
|
|
757
848
|
// define exports
|
|
758
849
|
module.exports = {
|
|
759
850
|
ERR_INTEGRITY_ERROR_CODES,
|
|
@@ -839,15 +930,15 @@ module.exports = {
|
|
|
839
930
|
ERR_NO_CONFIG_DIR,
|
|
840
931
|
ERR_TNS_ENTRY_NOT_FOUND,
|
|
841
932
|
ERR_CONNECTION_EOF,
|
|
842
|
-
ERR_AZURE_CONFIG_PROVIDER_AUTH_FAILED,
|
|
843
|
-
ERR_OCIOBJECT_CONFIG_PROVIDER_AUTH_FAILED,
|
|
844
|
-
ERR_AZURE_VAULT_AUTH_FAILED,
|
|
845
|
-
ERR_AZURE_SERVICE_PRINCIPAL_AUTH_FAILED,
|
|
846
933
|
ERR_CONFIG_PROVIDER_FAILED_TO_RETRIEVE_CONFIG,
|
|
847
|
-
|
|
848
|
-
|
|
934
|
+
ERR_CONFIG_PROVIDER_PARAM_TYPE,
|
|
935
|
+
ERR_REGISTER_HOOKFN_CONFIGPROVIDER,
|
|
936
|
+
ERR_DATA_COMPRESSION,
|
|
849
937
|
ERR_WALLET_TYPE_NOT_SUPPORTED,
|
|
850
938
|
ERR_HOST_NOT_FOUND,
|
|
939
|
+
ERR_ANO_PACKET,
|
|
940
|
+
ERR_ANO_STATUS,
|
|
941
|
+
ERR_ANO_NEGOTIATION,
|
|
851
942
|
ERR_INVALID_BIND_NAME,
|
|
852
943
|
ERR_WRONG_NUMBER_OF_BINDS,
|
|
853
944
|
ERR_BUFFER_LENGTH_INSUFFICIENT,
|
|
@@ -905,10 +996,25 @@ module.exports = {
|
|
|
905
996
|
ERR_UNKNOWN_TRANSACTION_STATE,
|
|
906
997
|
ERR_INVALID_TRANSACTION_SIZE,
|
|
907
998
|
ERR_INVALID_BRANCH_SIZE,
|
|
999
|
+
ERR_SESSIONLESS_DIFFERING_METHODS,
|
|
1000
|
+
ERR_SESSIONLESS_ALREADY_ACTIVE,
|
|
1001
|
+
ERR_SESSIONLESS_INACTIVE,
|
|
908
1002
|
ERR_CONNECTION_CLOSED_CODE: `${ERR_PREFIX}-${ERR_CONNECTION_CLOSED}`,
|
|
909
1003
|
ERR_OPERATION_NOT_SUPPORTED_ON_BFILE,
|
|
910
1004
|
ERR_OPERATION_ONLY_SUPPORTED_ON_BFILE,
|
|
911
1005
|
ERR_EXECMANY_NOT_ALLOWED_ON_QUERIES,
|
|
1006
|
+
ERR_VECTOR_SPARSE_INDICES_IS_NOT_ARRAY,
|
|
1007
|
+
ERR_VECTOR_SPARSE_VALUES_IS_NOT_ARRAY,
|
|
1008
|
+
ERR_VECTOR_SPARSE_DIMS_IS_NOT_INTEGER,
|
|
1009
|
+
ERR_VECTOR_SPARSE_INDICES_VALUES_NOT_EQUAL,
|
|
1010
|
+
ERR_VECTOR_SPARSE_INVALID_JSON,
|
|
1011
|
+
ERR_VECTOR_SPARSE_INVALID_STRING,
|
|
1012
|
+
ERR_VECTOR_SPARSE_INVALID_INPUT,
|
|
1013
|
+
ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID,
|
|
1014
|
+
ERR_DB_FETCH_TYPE_HANDLER_CONVERTER,
|
|
1015
|
+
ERR_DB_FETCH_TYPE_HANDLER_RETURN_VALUE,
|
|
1016
|
+
ERR_ACCESS_TOKEN,
|
|
1017
|
+
ERR_CALLOUT_FN,
|
|
912
1018
|
WRN_COMPILATION_CREATE,
|
|
913
1019
|
assert,
|
|
914
1020
|
assertArgCount,
|
|
@@ -923,6 +1029,8 @@ module.exports = {
|
|
|
923
1029
|
assertPropValue,
|
|
924
1030
|
getErr,
|
|
925
1031
|
throwErr,
|
|
1032
|
+
throwErrWithORAError,
|
|
926
1033
|
throwNotImplemented,
|
|
927
|
-
transformErr
|
|
1034
|
+
transformErr,
|
|
1035
|
+
throwWrapErr
|
|
928
1036
|
};
|
package/lib/impl/connection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (c) 2022,
|
|
1
|
+
// Copyright (c) 2022, 2025, Oracle and/or its affiliates.
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
@@ -289,6 +289,25 @@ 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
|
+
|
|
301
|
+
//---------------------------------------------------------------------------
|
|
302
|
+
// getMaxIdentifierLength()
|
|
303
|
+
//
|
|
304
|
+
// Returns the maximum length of identifiers supported by the database to
|
|
305
|
+
// which this connection has been established.
|
|
306
|
+
//---------------------------------------------------------------------------
|
|
307
|
+
getMaxIdentifierLength() {
|
|
308
|
+
errors.throwNotImplemented("getting the maximum identifier length");
|
|
309
|
+
}
|
|
310
|
+
|
|
292
311
|
//---------------------------------------------------------------------------
|
|
293
312
|
// getMaxOpenCursors()
|
|
294
313
|
//
|
|
@@ -399,6 +418,10 @@ class ConnectionImpl {
|
|
|
399
418
|
errors.throwNotImplemented("getting the health of the connection");
|
|
400
419
|
}
|
|
401
420
|
|
|
421
|
+
isCompressionEnabled() {
|
|
422
|
+
errors.throwNotImplemented("getting the data compression status on the connection");
|
|
423
|
+
}
|
|
424
|
+
|
|
402
425
|
//---------------------------------------------------------------------------
|
|
403
426
|
// ping()
|
|
404
427
|
//
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (c) 2022,
|
|
1
|
+
// Copyright (c) 2022, 2025, Oracle and/or its affiliates.
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
@@ -188,6 +188,36 @@ class BaseBuffer {
|
|
|
188
188
|
buf[5] - 1, buf[6] - 1, fseconds, 0);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
//---------------------------------------------------------------------------
|
|
192
|
+
// parseOracleIntervalYM()
|
|
193
|
+
//
|
|
194
|
+
// Parses an Oracle interval year-to-month (YM) from the supplied buffer
|
|
195
|
+
// and returns a corresponding IntervalYM object representing that value.
|
|
196
|
+
// This object contains attributes for years and months.
|
|
197
|
+
//---------------------------------------------------------------------------
|
|
198
|
+
parseOracleIntervalYM(buf) {
|
|
199
|
+
const years = buf.readUInt32BE() - constants.TNS_DURATION_MID;
|
|
200
|
+
const months = buf[4] - constants.TNS_DURATION_OFFSET;
|
|
201
|
+
return new types.IntervalYM({ years: years, months: months });
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
//---------------------------------------------------------------------------
|
|
205
|
+
// parseOracleIntervalDS()
|
|
206
|
+
//
|
|
207
|
+
// Parses an Oracle interval day-to-second (DS) from the supplied buffer
|
|
208
|
+
// and returns a corresponding IntervalDS object representing that value.
|
|
209
|
+
// This object contains attributes for day and time units.
|
|
210
|
+
//---------------------------------------------------------------------------
|
|
211
|
+
parseOracleIntervalDS(buf) {
|
|
212
|
+
const days = buf.readUInt32BE() - constants.TNS_DURATION_MID;
|
|
213
|
+
const fseconds = buf.readUInt32BE(7) - constants.TNS_DURATION_MID;
|
|
214
|
+
const hours = buf[4] - constants.TNS_DURATION_OFFSET;
|
|
215
|
+
const minutes = buf[5] - constants.TNS_DURATION_OFFSET;
|
|
216
|
+
const seconds = buf[6] - constants.TNS_DURATION_OFFSET;
|
|
217
|
+
return new types.IntervalDS({ days: days, hours: hours, minutes: minutes,
|
|
218
|
+
seconds: seconds, fseconds: fseconds });
|
|
219
|
+
}
|
|
220
|
+
|
|
191
221
|
//---------------------------------------------------------------------------
|
|
192
222
|
// parseOracleNumber()
|
|
193
223
|
//
|
|
@@ -430,6 +460,34 @@ class BaseBuffer {
|
|
|
430
460
|
return this.parseOracleDate(buf, useLocalTime);
|
|
431
461
|
}
|
|
432
462
|
|
|
463
|
+
//---------------------------------------------------------------------------
|
|
464
|
+
// readOracleIntervalYM()
|
|
465
|
+
//
|
|
466
|
+
// Reads interval year to month value from the buffer and returns a
|
|
467
|
+
// JavaScript object representing that value.
|
|
468
|
+
//---------------------------------------------------------------------------
|
|
469
|
+
readOracleIntervalYM() {
|
|
470
|
+
const buf = this.readBytesWithLength();
|
|
471
|
+
if (!buf) {
|
|
472
|
+
return null;
|
|
473
|
+
}
|
|
474
|
+
return this.parseOracleIntervalYM(buf);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
//---------------------------------------------------------------------------
|
|
478
|
+
// readOracleIntervalDS()
|
|
479
|
+
//
|
|
480
|
+
// Reads interval day to second value from the buffer and returns a
|
|
481
|
+
// JavaScript object representing that value.
|
|
482
|
+
//---------------------------------------------------------------------------
|
|
483
|
+
readOracleIntervalDS() {
|
|
484
|
+
const buf = this.readBytesWithLength();
|
|
485
|
+
if (!buf) {
|
|
486
|
+
return null;
|
|
487
|
+
}
|
|
488
|
+
return this.parseOracleIntervalDS(buf);
|
|
489
|
+
}
|
|
490
|
+
|
|
433
491
|
//---------------------------------------------------------------------------
|
|
434
492
|
// readOracleNumber()
|
|
435
493
|
//
|
|
@@ -801,6 +859,39 @@ class BaseBuffer {
|
|
|
801
859
|
}
|
|
802
860
|
}
|
|
803
861
|
|
|
862
|
+
//---------------------------------------------------------------------------
|
|
863
|
+
// writeOracleIntervalYM()
|
|
864
|
+
//
|
|
865
|
+
// Writes a time interval to the buffer in Oracle Interval Year To Month
|
|
866
|
+
// format. It is assumed that the 'value' parameter is a valid IntervalYM
|
|
867
|
+
// object at this stage.
|
|
868
|
+
//---------------------------------------------------------------------------
|
|
869
|
+
writeOracleIntervalYM(value, writeLength = true) {
|
|
870
|
+
if (writeLength) {
|
|
871
|
+
this.writeUInt8(5);
|
|
872
|
+
}
|
|
873
|
+
this.writeUInt32BE(value.years + constants.TNS_DURATION_MID);
|
|
874
|
+
this.writeUInt8(value.months + constants.TNS_DURATION_OFFSET);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
//---------------------------------------------------------------------------
|
|
878
|
+
// writeOracleIntervalDS()
|
|
879
|
+
//
|
|
880
|
+
// Writes a time interval to the buffer in Oracle Interval Day To Second
|
|
881
|
+
// format. It is assumed that the 'value' parameter is a valid IntervalDS
|
|
882
|
+
// object at this stage.
|
|
883
|
+
//---------------------------------------------------------------------------
|
|
884
|
+
writeOracleIntervalDS(value, writeLength = true) {
|
|
885
|
+
if (writeLength) {
|
|
886
|
+
this.writeUInt8(11);
|
|
887
|
+
}
|
|
888
|
+
this.writeUInt32BE(value.days + constants.TNS_DURATION_MID);
|
|
889
|
+
this.writeUInt8(value.hours + constants.TNS_DURATION_OFFSET);
|
|
890
|
+
this.writeUInt8(value.minutes + constants.TNS_DURATION_OFFSET);
|
|
891
|
+
this.writeUInt8(value.seconds + constants.TNS_DURATION_OFFSET);
|
|
892
|
+
this.writeUInt32BE(value.fseconds + constants.TNS_DURATION_MID);
|
|
893
|
+
}
|
|
894
|
+
|
|
804
895
|
//---------------------------------------------------------------------------
|
|
805
896
|
// writeOracleNumber()
|
|
806
897
|
//
|
|
@@ -34,10 +34,12 @@ module.exports = {
|
|
|
34
34
|
TNS_VECTOR_MAGIC_BYTE: 0xDB,
|
|
35
35
|
TNS_VECTOR_VERSION_BASE: 0,
|
|
36
36
|
TNS_VECTOR_VERSION_WITH_BINARY: 1,
|
|
37
|
+
TNS_VECTOR_VERSION_WITH_SPARSE: 2,
|
|
37
38
|
|
|
38
39
|
// vector flags
|
|
39
40
|
TNS_VECTOR_FLAG_NORMSRC: 0x0010,
|
|
40
41
|
TNS_VECTOR_FLAG_NORM: 0x0002,
|
|
42
|
+
TNS_VECTOR_FLAG_SPARSE: 0x0020,
|
|
41
43
|
|
|
42
44
|
// base JSON constants
|
|
43
45
|
TNS_JSON_MAGIC_BYTE_1: 0xff,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright (c) 2023,
|
|
1
|
+
// Copyright (c) 2023, 2025, Oracle and/or its affiliates.
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
@@ -138,6 +138,12 @@ class OsonDecoder extends BaseBuffer {
|
|
|
138
138
|
} else if (nodeType === constants.TNS_JSON_TYPE_BINARY_DOUBLE) {
|
|
139
139
|
return this.parseBinaryDouble(this.readBytes(8));
|
|
140
140
|
|
|
141
|
+
// handle interval datatypes
|
|
142
|
+
} else if (nodeType === constants.TNS_JSON_TYPE_INTERVAL_YM) {
|
|
143
|
+
return this.parseOracleIntervalYM(this.readBytes(5));
|
|
144
|
+
} else if (nodeType === constants.TNS_JSON_TYPE_INTERVAL_DS) {
|
|
145
|
+
return this.parseOracleIntervalDS(this.readBytes(11));
|
|
146
|
+
|
|
141
147
|
// handle scalars with lengths stored outside the node itself
|
|
142
148
|
} else if (nodeType === constants.TNS_JSON_TYPE_STRING_LENGTH_UINT8) {
|
|
143
149
|
return this.readBytes(this.readUInt8()).toString();
|
|
@@ -573,6 +579,14 @@ class OsonTreeSegment extends GrowableBuffer {
|
|
|
573
579
|
this.writeOracleDate(value, types.DB_TYPE_TIMESTAMP, false);
|
|
574
580
|
}
|
|
575
581
|
|
|
582
|
+
// handle interval data types
|
|
583
|
+
} else if (value instanceof types.IntervalYM) {
|
|
584
|
+
this.writeUInt8(constants.TNS_JSON_TYPE_INTERVAL_YM);
|
|
585
|
+
this.writeOracleIntervalYM(value, false);
|
|
586
|
+
} else if (value instanceof types.IntervalDS) {
|
|
587
|
+
this.writeUInt8(constants.TNS_JSON_TYPE_INTERVAL_DS);
|
|
588
|
+
this.writeOracleIntervalDS(value, false);
|
|
589
|
+
|
|
576
590
|
// handle buffers
|
|
577
591
|
} else if (Buffer.isBuffer(value)) {
|
|
578
592
|
if (value.length < 65536) {
|