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/parser.js ADDED
@@ -0,0 +1,204 @@
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
+ function isUnicodeLetter(ch) {
30
+ return /^\p{L}$/u.test(ch);
31
+ }
32
+
33
+ function isUnicodeDigit(ch) {
34
+ return /^\p{Nd}$/u.test(ch);
35
+ }
36
+
37
+ function isUnicodeMark(ch) {
38
+ return /^\p{M}$/u.test(ch);
39
+ }
40
+
41
+ function isWhitespace(ch) {
42
+ return /^\s$/u.test(ch);
43
+ }
44
+
45
+ function isUnquotedIdentifierChar(ch) {
46
+ return isUnicodeLetter(ch) || isUnicodeMark(ch) || isUnicodeDigit(ch) ||
47
+ ch === '_' || ch === '$' || ch === '#';
48
+ }
49
+
50
+ //-----------------------------------------------------------------------------
51
+ // enquoteLiteral()
52
+ //
53
+ // Returns a quoted SQL literal with embedded single quotes doubled.
54
+ //-----------------------------------------------------------------------------
55
+ function enquoteLiteral(value) {
56
+ return `'${value.replace(/'/g, "''")}'`;
57
+ }
58
+
59
+ //-----------------------------------------------------------------------------
60
+ // readChar()
61
+ //
62
+ // Returns the Unicode character at the specified UTF-16 index together with the
63
+ // number of UTF-16 code units consumed. This keeps parser indexing correct for
64
+ // supplementary characters.
65
+ //-----------------------------------------------------------------------------
66
+ function readChar(str, index) {
67
+ if (index >= str.length) {
68
+ return;
69
+ }
70
+ // Read one complete Unicode code point so surrogate pairs are handled as a
71
+ // single character by the parser.
72
+ const cp = str.codePointAt(index);
73
+ const ch = String.fromCodePoint(cp);
74
+ return { ch, size: ch.length };
75
+ }
76
+
77
+ //-----------------------------------------------------------------------------
78
+ // skipSpaces()
79
+ //
80
+ // Advances past any Unicode whitespace characters and returns the next
81
+ // non-whitespace index.
82
+ //-----------------------------------------------------------------------------
83
+ function skipSpaces(str, index) {
84
+ while (index < str.length) {
85
+ const next = readChar(str, index);
86
+ if (!isWhitespace(next.ch)) {
87
+ break;
88
+ }
89
+ // Advance by the width of the full code point rather than a single code
90
+ // unit.
91
+ index += next.size;
92
+ }
93
+ return index;
94
+ }
95
+
96
+ //-----------------------------------------------------------------------------
97
+ // parseQuotedSimpleSqlName()
98
+ //
99
+ // Parses a quoted identifier. The opening quote is assumed to be at the
100
+ // supplied index. Quoted identifiers must be non-empty and cannot contain a
101
+ // raw double quote or a \u0000 character. The returned index points just after
102
+ // the closing quote.
103
+ //-----------------------------------------------------------------------------
104
+ function parseQuotedSimpleSqlName(str, index) {
105
+ index += 1;
106
+ let hasContent = false;
107
+
108
+ while (index < str.length) {
109
+ const cur = readChar(str, index);
110
+ if (cur.ch === '"') {
111
+ // Reject empty quoted identifiers; otherwise consume the closing quote.
112
+ return hasContent ? index + cur.size : undefined;
113
+ }
114
+ if (cur.ch === '\u0000') {
115
+ return;
116
+ }
117
+
118
+ // Any non-quote, non-NUL character is accepted inside quoted names.
119
+ hasContent = true;
120
+ index += cur.size;
121
+ }
122
+ }
123
+
124
+ //-----------------------------------------------------------------------------
125
+ // parseUnquotedSimpleSqlName()
126
+ //
127
+ // Parses an unquoted identifier. The first character must be a Unicode letter.
128
+ // Remaining characters may be Unicode letters, combining marks, decimal
129
+ // digits, or _, $, #. Parsing stops before the first character that is not part
130
+ // of the identifier.
131
+ //-----------------------------------------------------------------------------
132
+ function parseUnquotedSimpleSqlName(str, index) {
133
+ const first = readChar(str, index);
134
+ if (!first || !isUnicodeLetter(first.ch)) {
135
+ return;
136
+ }
137
+
138
+ // Consume the required leading Unicode letter first.
139
+ index += first.size;
140
+ while (index < str.length) {
141
+ const cur = readChar(str, index);
142
+ if (!isUnquotedIdentifierChar(cur.ch)) {
143
+ break;
144
+ }
145
+ index += cur.size;
146
+ }
147
+
148
+ return index;
149
+ }
150
+
151
+ //-----------------------------------------------------------------------------
152
+ // parseSimpleSqlName()
153
+ //
154
+ // Parses one simple identifier component, quoted or unquoted, and returns the
155
+ // index just after the parsed component.
156
+ //-----------------------------------------------------------------------------
157
+ function parseSimpleSqlName(str, index) {
158
+ const cur = readChar(str, index);
159
+ if (!cur) {
160
+ return;
161
+ }
162
+ return cur.ch === '"' ? parseQuotedSimpleSqlName(str, index)
163
+ : parseUnquotedSimpleSqlName(str, index);
164
+ }
165
+
166
+ //-----------------------------------------------------------------------------
167
+ // parseQualifiedSqlName()
168
+ //
169
+ // Parses a qualified SQL name made up of one or more simple SQL names
170
+ // separated by dots, optionally followed by an @ database link name that can
171
+ // itself contain dotted simple SQL names. The returned index points just
172
+ // after the parsed qualified name; undefined is returned if parsing fails.
173
+ //-----------------------------------------------------------------------------
174
+ function parseQualifiedSqlName(str, index) {
175
+ let foundDbLink = false;
176
+
177
+ while (true) {
178
+ const parsedIndex = parseSimpleSqlName(str, index);
179
+ if (parsedIndex === undefined) {
180
+ return;
181
+ }
182
+
183
+ index = skipSpaces(str, parsedIndex);
184
+
185
+ if (index === str.length) {
186
+ return index;
187
+ }
188
+
189
+ const separator = readChar(str, index);
190
+ index = skipSpaces(str, index + separator.size);
191
+
192
+ if (!foundDbLink && separator.ch === '@') {
193
+ foundDbLink = true;
194
+ } else if (separator.ch !== '.') {
195
+ return;
196
+ }
197
+ }
198
+ }
199
+
200
+ module.exports = {
201
+ enquoteLiteral,
202
+ parseQualifiedSqlName,
203
+ parseSimpleSqlName
204
+ };
@@ -0,0 +1,113 @@
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 errors = require('./errors.js');
30
+ const nodbUtil = require('./util.js');
31
+ const settings = require('./settings.js');
32
+
33
+ class Pipeline {
34
+ constructor() {
35
+ this.operations = []; // operations in pipeline.
36
+ }
37
+
38
+ _validExecOptions = [
39
+ 'autoCommit', 'fetchArraySize', 'maxRows', 'outFormat', 'prefetchRows'
40
+ ];
41
+
42
+ _validExecManyOptions = [...this._validExecOptions, 'bindDefs'];
43
+
44
+ _checkOptions(opts, validOptions) {
45
+ if (opts && typeof opts === 'object') {
46
+ for (const [k,] of Object.entries(opts)) {
47
+ if (!validOptions.includes(k))
48
+ errors.throwErr(errors.ERR_PIPELINE_EXEC_OPTION_NOT_SUPPORTED, k);
49
+ }
50
+ }
51
+ }
52
+
53
+ _addOperation(opType, data = {}) {
54
+ if (['execute', 'fetchOne', 'fetchMany', 'fetchAll'].includes(opType))
55
+ this._checkOptions(data.options, this._validExecOptions);
56
+ else if (opType === 'executeMany')
57
+ this._checkOptions(data.options, this._validExecManyOptions);
58
+ this.operations.push({ opType, ...data });
59
+ }
60
+
61
+ addExecute(statement, parameters = [], options = {}) {
62
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
63
+ this._addOperation('execute', { statement, parameters, options });
64
+ }
65
+
66
+ addExecuteMany(statement, parameters, options = {}) {
67
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
68
+ this._addOperation('executeMany', { statement, parameters, options });
69
+ }
70
+
71
+ addFetchOne(statement, parameters = [], options = {}, fetchLobs = true) {
72
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
73
+ options.prefetchRows = options.prefetchRows ?? 1;
74
+ options.fetchArraySize = options.fetchArraySize ?? 1;
75
+ errors.assertParamValue(typeof fetchLobs === 'boolean', 4);
76
+ this._addOperation('fetchOne', { statement, parameters, options,
77
+ fetchLobs});
78
+ }
79
+
80
+ addFetchMany(statement, parameters = [], options = {},
81
+ numRows = settings.fetchArraySize, fetchLobs = true) {
82
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
83
+ options.prefetchRows = options.prefetchRows ?? numRows;
84
+ if (numRows > 0)
85
+ options.fetchArraySize = options.fetchArraySize ?? numRows;
86
+ errors.assertParamValue(Number.isInteger(numRows) && numRows >= 0, 4);
87
+ errors.assertParamValue(typeof fetchLobs === 'boolean', 5);
88
+ this._addOperation('fetchMany', { statement, parameters, options,
89
+ numRows, fetchLobs});
90
+ }
91
+
92
+ addFetchAll(statement, parameters = [], options = {},
93
+ fetchArraySize, fetchLobs) {
94
+ errors.assertParamValue(nodbUtil.isObject(options), 3);
95
+ fetchArraySize = fetchArraySize ?? options.fetchArraySize ??
96
+ settings.fetchArraySize;
97
+ options.prefetchRows = options.prefetchRows ?? fetchArraySize;
98
+ options.fetchArraySize = fetchArraySize;
99
+ fetchLobs = fetchLobs ?? true;
100
+ errors.assertParamValue(Number.isInteger(fetchArraySize) &&
101
+ fetchArraySize > 0, 4);
102
+ errors.assertParamValue(typeof fetchLobs === 'boolean', 5);
103
+ this._addOperation('fetchAll', { statement, parameters, options,
104
+ fetchArraySize, fetchLobs});
105
+ }
106
+
107
+ addCommit() {
108
+ this._addOperation('commit', {});
109
+ }
110
+
111
+ }
112
+
113
+ module.exports = Pipeline;