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.
- package/CHANGELOG.md +135 -8
- package/README.md +6 -4
- package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-linux-x64.node +0 -0
- package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi48-win32-x64.node +0 -0
- package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-linux-x64.node +0 -0
- package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi57-win32-x64.node +0 -0
- package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-linux-x64.node +0 -0
- package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi64-win32-x64.node +0 -0
- package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
- package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-linux-x64.node +0 -0
- package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-abi67-win32-x64.node +0 -0
- package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
- package/lib/connection.js +18 -4
- package/lib/oracledb.js +44 -92
- package/lib/pool.js +36 -2
- package/lib/sodaCollection.js +1 -1
- package/lib/sodaDatabase.js +1 -1
- package/lib/util.js +82 -5
- package/package/README.md +32 -101
- package/package/install.js +139 -0
- package/package/prunebinaries.js +51 -0
- package/package.json +4 -11
- package/binding.gyp +0 -162
- package/lib/rel.txt +0 -1
- package/odpi/.npmignore +0 -4
- package/odpi/LICENSE.md +0 -218
- package/odpi/README.md +0 -61
- package/odpi/embed/README.md +0 -4
- package/odpi/embed/dpi.c +0 -50
- package/odpi/include/dpi.h +0 -1748
- package/odpi/src/dpiConn.c +0 -2089
- package/odpi/src/dpiContext.c +0 -296
- package/odpi/src/dpiData.c +0 -797
- package/odpi/src/dpiDebug.c +0 -184
- package/odpi/src/dpiDeqOptions.c +0 -370
- package/odpi/src/dpiEnqOptions.c +0 -174
- package/odpi/src/dpiEnv.c +0 -189
- package/odpi/src/dpiError.c +0 -204
- package/odpi/src/dpiErrorMessages.h +0 -86
- package/odpi/src/dpiGen.c +0 -303
- package/odpi/src/dpiGlobal.c +0 -292
- package/odpi/src/dpiHandleList.c +0 -117
- package/odpi/src/dpiHandlePool.c +0 -118
- package/odpi/src/dpiImpl.h +0 -1707
- package/odpi/src/dpiLob.c +0 -506
- package/odpi/src/dpiMsgProps.c +0 -386
- package/odpi/src/dpiObject.c +0 -897
- package/odpi/src/dpiObjectAttr.c +0 -115
- package/odpi/src/dpiObjectType.c +0 -326
- package/odpi/src/dpiOci.c +0 -3527
- package/odpi/src/dpiOracleType.c +0 -492
- package/odpi/src/dpiPool.c +0 -549
- package/odpi/src/dpiRowid.c +0 -136
- package/odpi/src/dpiSodaColl.c +0 -685
- package/odpi/src/dpiSodaCollCursor.c +0 -143
- package/odpi/src/dpiSodaDb.c +0 -432
- package/odpi/src/dpiSodaDoc.c +0 -230
- package/odpi/src/dpiSodaDocCursor.c +0 -143
- package/odpi/src/dpiStmt.c +0 -1797
- package/odpi/src/dpiSubscr.c +0 -674
- package/odpi/src/dpiUtils.c +0 -410
- package/odpi/src/dpiVar.c +0 -1794
- package/package/MAKEPKG.BAT +0 -156
- package/package/Makefile +0 -85
- package/package/createpackage.js +0 -186
- package/package/extractpackage.js +0 -76
- package/package/getversion.js +0 -37
- package/package/oracledbinstall.js +0 -497
- package/package/package.json +0 -54
- package/package/util.js +0 -286
- package/src/njsCommon.cpp +0 -1055
- package/src/njsCommon.h +0 -484
- package/src/njsConnection.cpp +0 -2926
- package/src/njsConnection.h +0 -227
- package/src/njsIntLob.cpp +0 -618
- package/src/njsIntLob.h +0 -179
- package/src/njsMessages.cpp +0 -122
- package/src/njsMessages.h +0 -118
- package/src/njsOracle.cpp +0 -1274
- package/src/njsOracle.h +0 -237
- package/src/njsPool.cpp +0 -482
- package/src/njsPool.h +0 -132
- package/src/njsResultSet.cpp +0 -478
- package/src/njsResultSet.h +0 -120
- package/src/njsSodaCollection.cpp +0 -507
- package/src/njsSodaCollection.h +0 -128
- package/src/njsSodaDatabase.cpp +0 -335
- package/src/njsSodaDatabase.h +0 -108
- package/src/njsSodaDocCursor.cpp +0 -203
- package/src/njsSodaDocCursor.h +0 -94
- package/src/njsSodaDocument.cpp +0 -412
- package/src/njsSodaDocument.h +0 -105
- package/src/njsSodaOperation.cpp +0 -557
- package/src/njsSodaOperation.h +0 -123
- package/src/njsSubscription.cpp +0 -388
- package/src/njsSubscription.h +0 -111
- package/src/njsUtils.cpp +0 -158
- 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;
|