oracledb 3.0.0 → 3.1.2

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 (112) hide show
  1. package/CHANGELOG.md +135 -8
  2. package/README.md +6 -4
  3. package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
  4. package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
  5. package/build/Release/oracledb-abi48-linux-x64.node +0 -0
  6. package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-abi48-win32-x64.node +0 -0
  8. package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
  10. package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-abi57-linux-x64.node +0 -0
  12. package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-abi57-win32-x64.node +0 -0
  14. package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
  15. package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
  16. package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
  17. package/build/Release/oracledb-abi64-linux-x64.node +0 -0
  18. package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
  19. package/build/Release/oracledb-abi64-win32-x64.node +0 -0
  20. package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
  21. package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
  22. package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
  23. package/build/Release/oracledb-abi67-linux-x64.node +0 -0
  24. package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
  25. package/build/Release/oracledb-abi67-win32-x64.node +0 -0
  26. package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
  27. package/lib/connection.js +18 -4
  28. package/lib/oracledb.js +44 -92
  29. package/lib/pool.js +36 -2
  30. package/lib/sodaCollection.js +1 -1
  31. package/lib/sodaDatabase.js +1 -1
  32. package/lib/util.js +82 -5
  33. package/package/README.md +32 -101
  34. package/package/install.js +139 -0
  35. package/package/prunebinaries.js +51 -0
  36. package/package.json +4 -11
  37. package/binding.gyp +0 -162
  38. package/lib/rel.txt +0 -1
  39. package/odpi/.npmignore +0 -4
  40. package/odpi/LICENSE.md +0 -218
  41. package/odpi/README.md +0 -61
  42. package/odpi/embed/README.md +0 -4
  43. package/odpi/embed/dpi.c +0 -50
  44. package/odpi/include/dpi.h +0 -1748
  45. package/odpi/src/dpiConn.c +0 -2089
  46. package/odpi/src/dpiContext.c +0 -296
  47. package/odpi/src/dpiData.c +0 -797
  48. package/odpi/src/dpiDebug.c +0 -184
  49. package/odpi/src/dpiDeqOptions.c +0 -370
  50. package/odpi/src/dpiEnqOptions.c +0 -174
  51. package/odpi/src/dpiEnv.c +0 -189
  52. package/odpi/src/dpiError.c +0 -204
  53. package/odpi/src/dpiErrorMessages.h +0 -86
  54. package/odpi/src/dpiGen.c +0 -303
  55. package/odpi/src/dpiGlobal.c +0 -292
  56. package/odpi/src/dpiHandleList.c +0 -117
  57. package/odpi/src/dpiHandlePool.c +0 -118
  58. package/odpi/src/dpiImpl.h +0 -1707
  59. package/odpi/src/dpiLob.c +0 -506
  60. package/odpi/src/dpiMsgProps.c +0 -386
  61. package/odpi/src/dpiObject.c +0 -897
  62. package/odpi/src/dpiObjectAttr.c +0 -115
  63. package/odpi/src/dpiObjectType.c +0 -326
  64. package/odpi/src/dpiOci.c +0 -3527
  65. package/odpi/src/dpiOracleType.c +0 -492
  66. package/odpi/src/dpiPool.c +0 -549
  67. package/odpi/src/dpiRowid.c +0 -136
  68. package/odpi/src/dpiSodaColl.c +0 -685
  69. package/odpi/src/dpiSodaCollCursor.c +0 -143
  70. package/odpi/src/dpiSodaDb.c +0 -432
  71. package/odpi/src/dpiSodaDoc.c +0 -230
  72. package/odpi/src/dpiSodaDocCursor.c +0 -143
  73. package/odpi/src/dpiStmt.c +0 -1797
  74. package/odpi/src/dpiSubscr.c +0 -674
  75. package/odpi/src/dpiUtils.c +0 -410
  76. package/odpi/src/dpiVar.c +0 -1794
  77. package/package/MAKEPKG.BAT +0 -156
  78. package/package/Makefile +0 -85
  79. package/package/createpackage.js +0 -186
  80. package/package/extractpackage.js +0 -76
  81. package/package/getversion.js +0 -37
  82. package/package/oracledbinstall.js +0 -497
  83. package/package/package.json +0 -54
  84. package/package/util.js +0 -286
  85. package/src/njsCommon.cpp +0 -1055
  86. package/src/njsCommon.h +0 -484
  87. package/src/njsConnection.cpp +0 -2926
  88. package/src/njsConnection.h +0 -227
  89. package/src/njsIntLob.cpp +0 -618
  90. package/src/njsIntLob.h +0 -179
  91. package/src/njsMessages.cpp +0 -122
  92. package/src/njsMessages.h +0 -118
  93. package/src/njsOracle.cpp +0 -1274
  94. package/src/njsOracle.h +0 -237
  95. package/src/njsPool.cpp +0 -482
  96. package/src/njsPool.h +0 -132
  97. package/src/njsResultSet.cpp +0 -478
  98. package/src/njsResultSet.h +0 -120
  99. package/src/njsSodaCollection.cpp +0 -507
  100. package/src/njsSodaCollection.h +0 -128
  101. package/src/njsSodaDatabase.cpp +0 -335
  102. package/src/njsSodaDatabase.h +0 -108
  103. package/src/njsSodaDocCursor.cpp +0 -203
  104. package/src/njsSodaDocCursor.h +0 -94
  105. package/src/njsSodaDocument.cpp +0 -412
  106. package/src/njsSodaDocument.h +0 -105
  107. package/src/njsSodaOperation.cpp +0 -557
  108. package/src/njsSodaOperation.h +0 -123
  109. package/src/njsSubscription.cpp +0 -388
  110. package/src/njsSubscription.h +0 -111
  111. package/src/njsUtils.cpp +0 -158
  112. package/src/njsUtils.h +0 -68
package/package/util.js DELETED
@@ -1,286 +0,0 @@
1
- /* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. */
2
-
3
- /******************************************************************************
4
- *
5
- * You may not use the identified files except in compliance with the Apache
6
- * License, Version 2.0 (the "License.")
7
- *
8
- * You may obtain a copy of the License at
9
- * http://www.apache.org/licenses/LICENSE-2.0.
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- *
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- *****************************************************************************/
19
-
20
- 'use strict';
21
-
22
- const fs = require('fs');
23
- const zlib = require('zlib');
24
- const path = require('path');
25
- const util = require('util');
26
- const debug = (process.env.NODE_ORACLEDB_TRACE_INSTALL === 'TRUE') ? true : false;
27
-
28
- let crypto;
29
-
30
- try {
31
- crypto = require('crypto');
32
- } catch (err) {
33
- // Ignoring this to allow other parts of the module to be used.
34
- }
35
-
36
- const LICENSE_FILE_NAME = 'LICENSE.md';
37
- module.exports.LICENSE_FILE_NAME = LICENSE_FILE_NAME;
38
-
39
- const LICENSE_PATH_LOCAL = path.normalize(__dirname + '/../') + LICENSE_FILE_NAME;
40
- module.exports.LICENSE_PATH_LOCAL = LICENSE_PATH_LOCAL;
41
-
42
- const BINARY_FILE_NAME = 'oracledb.node';
43
- module.exports.BINARY_FILE_NAME = BINARY_FILE_NAME;
44
-
45
- const BINARY_PATH_LOCAL = path.normalize(__dirname + '/../build/Release/') + BINARY_FILE_NAME;
46
- module.exports.BINARY_PATH_LOCAL = BINARY_PATH_LOCAL;
47
-
48
- const SHA_FILE_NAME = 'SHASUMS256.txt';
49
- module.exports.SHA_FILE_NAME = SHA_FILE_NAME;
50
-
51
- const LICENSE_HEADER_BYTES = 10;
52
- module.exports.LICENSE_HEADER_BYTES = LICENSE_HEADER_BYTES;
53
-
54
- const dynamicProps = {};
55
- module.exports.dynamicProps = dynamicProps;
56
-
57
- // initDynamicProps is used to initalize some properties that are only needed
58
- // during install. This allows the util module to be used by the extract
59
- // module without requiring a package.json.
60
- function initDynamicProps() {
61
- trace('In initDynamicProps');
62
-
63
- let packageJSON;
64
-
65
- try {
66
- packageJSON = require('../package.json');
67
- } catch (err) {
68
- throw new Error('package.json required to install from binary');
69
- }
70
-
71
- const PACKAGE_JSON_VERSION = packageJSON.version;
72
- dynamicProps.PACKAGE_JSON_VERSION = PACKAGE_JSON_VERSION;
73
-
74
- let ght;
75
-
76
- // Get the package version from package.json
77
- if (packageJSON.version) {
78
- ght = 'v' + packageJSON.version; // assume name format is always the same
79
- } else {
80
- throw new Error('Cannot determine node-oracledb version from package.json');
81
- }
82
-
83
- const GITHUB_TAG = ght;
84
- dynamicProps.GITHUB_TAG = GITHUB_TAG;
85
-
86
- const BASE_BUILD_NAME = 'oracledb-'+ GITHUB_TAG + '-node-abi' + process.versions.modules + '-' + process.platform + '-' + process.arch;
87
-
88
- const BINARY_BUILD_NAME = BASE_BUILD_NAME + '-' + BINARY_FILE_NAME;
89
- dynamicProps.BINARY_BUILD_NAME = BINARY_BUILD_NAME;
90
-
91
- const PACKAGE_FILE_NAME = BASE_BUILD_NAME + '.gz';
92
- dynamicProps.PACKAGE_FILE_NAME = PACKAGE_FILE_NAME;
93
-
94
- trace('dynamicProps =', dynamicProps);
95
- }
96
-
97
- module.exports.initDynamicProps = initDynamicProps;
98
-
99
- // log is used to log standard output with the 'oracledb' prefix.
100
- function log(message) {
101
- const args = Array.from(arguments);
102
-
103
- args.unshift('oracledb');
104
-
105
- console.log.apply(console, args);
106
- }
107
-
108
- module.exports.log = log;
109
-
110
- // trace is used to log trace output when debug is enabled. It combines
111
- // 'oracledb' with a stylized 'TRACE' prefix.
112
- function trace(message) {
113
- if (debug) {
114
- const args = Array.from(arguments);
115
-
116
- args.unshift('oracledb \x1b[30m\x1b[45mTRACE\x1b[0m');
117
-
118
- console.log.apply(console, args);
119
- }
120
- }
121
-
122
- module.exports.trace = trace;
123
-
124
- // error is used to log errors. It combines 'oracledb' with a stylized 'ERR'
125
- // prefix.
126
- function error(message) {
127
- const args = Array.from(arguments);
128
-
129
- args.unshift('oracledb \x1b[31mERR!\x1b[0m');
130
-
131
- console.error.apply(console, args);
132
- }
133
-
134
- module.exports.error = error;
135
-
136
- // The getSha function is used to get the SHA of a file.
137
- function getSha(path) {
138
- trace('In getSha', path);
139
-
140
- return new Promise((resolve, reject) => {
141
- let settled = false;
142
- let hash;
143
-
144
- try {
145
- hash = crypto.createHash('sha256');
146
- } catch (err) {
147
- reject(err);
148
- settled = true;
149
- return;
150
- }
151
-
152
- const input = fs.createReadStream(path);
153
-
154
- input.on('error', err => {
155
- if (!settled) {
156
- reject(err);
157
- settled = true;
158
- }
159
- });
160
-
161
- input.on('readable', () => {
162
- const data = input.read();
163
-
164
- if (data) {
165
- hash.update(data);
166
- } else {
167
- const sha = hash.digest('hex');
168
-
169
- if (!settled) {
170
- trace('sha =', sha);
171
-
172
- resolve(sha);
173
- settled = true;
174
- }
175
- }
176
- });
177
- });
178
- }
179
-
180
- module.exports.getSha = getSha;
181
-
182
- // The extract function is used to extract the license and node-oracledb binary
183
- // from the custom file format that combines both.
184
- function extract(opts) {
185
- return new Promise((resolve, reject) => {
186
- trace('In extract', util.inspect(opts, {depth: 0}));
187
-
188
- const binaryDest = opts.binaryDest || process.cwd() + '/' + BINARY_FILE_NAME;
189
- const binaryWriteStream = fs.createWriteStream(binaryDest);
190
- const gunzip = zlib.createGunzip();
191
- let licenseWriteStream;
192
- let compressedReadstream;
193
- let settled = false;
194
- let licenseWritten = false;
195
- let binaryWritten = false;
196
-
197
- function checkDone() {
198
- if (!settled && licenseWritten && binaryWritten) {
199
- resolve();
200
- settled = true;
201
- }
202
- }
203
-
204
- if (opts.writeLicense === true) {
205
- const licenseDest = opts.licenseDest || process.cwd() + '/' + LICENSE_FILE_NAME;
206
-
207
- licenseWriteStream = fs.createWriteStream(licenseDest);
208
-
209
- licenseWriteStream.on('error', err => {
210
- if (!settled) {
211
- reject(err);
212
- settled = true;
213
- }
214
- });
215
-
216
- licenseWriteStream.on('finish', () => {
217
- licenseWritten = true;
218
- checkDone();
219
- });
220
- } else {
221
- licenseWritten = true;
222
- }
223
-
224
- binaryWriteStream.on('error', err => {
225
- if (!settled) {
226
- reject(err);
227
- settled = true;
228
- }
229
- });
230
-
231
- binaryWriteStream.on('finish', () => {
232
- binaryWritten = true;
233
- checkDone();
234
- });
235
-
236
- if (opts.compressedReadstream) {
237
- compressedReadstream = opts.compressedReadstream;
238
- } else if (opts.packagePath) {
239
- compressedReadstream = fs.createReadStream(opts.packagePath);
240
- }
241
-
242
- const unzipedReadStream = compressedReadstream.pipe(gunzip);
243
-
244
- let licenseFileSizeBytes;
245
- let licenseFileBytesWritten = 0;
246
-
247
- unzipedReadStream.on('close', () => {
248
- binaryWriteStream.end();
249
- });
250
-
251
- unzipedReadStream.on('data', chunk => {
252
- let bytesToWriteInThisEvent;
253
-
254
- if (licenseFileBytesWritten === 0) { // assumes first chunk size is > LICENSE_HEADER_BYTES
255
- licenseFileSizeBytes = parseInt(chunk.toString('ascii', 0, LICENSE_HEADER_BYTES));
256
- chunk = chunk.slice(LICENSE_HEADER_BYTES);
257
- }
258
-
259
- if (licenseFileBytesWritten < licenseFileSizeBytes) {
260
- const remainingLicenseBytesToWrite = licenseFileSizeBytes - licenseFileBytesWritten;
261
-
262
- bytesToWriteInThisEvent = (chunk.length > remainingLicenseBytesToWrite) ? remainingLicenseBytesToWrite : chunk.length;
263
-
264
- if (opts.writeLicense === true) {
265
- licenseWriteStream.write(chunk.slice(0, bytesToWriteInThisEvent));
266
- }
267
-
268
- licenseFileBytesWritten += bytesToWriteInThisEvent;
269
-
270
- if (opts.writeLicense === true && licenseFileBytesWritten === licenseFileSizeBytes) {
271
- licenseWriteStream.end();
272
- }
273
- }
274
-
275
- if (licenseFileBytesWritten >= licenseFileSizeBytes) {
276
- if (bytesToWriteInThisEvent) {
277
- binaryWriteStream.write(chunk.slice(bytesToWriteInThisEvent));
278
- } else {
279
- binaryWriteStream.write(chunk);
280
- }
281
- }
282
- });
283
- });
284
- }
285
-
286
- module.exports.extract = extract;