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
|
@@ -1,497 +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
|
-
* NAME
|
|
19
|
-
* oracledbinstall.js
|
|
20
|
-
*
|
|
21
|
-
* DESCRIPTION
|
|
22
|
-
* This script is included in the npm bundle of node-oracledb. It
|
|
23
|
-
* is invoked by package.json during npm install. It downloads a
|
|
24
|
-
* pre-built node-oracleb binary from GitHub if one is available, or
|
|
25
|
-
* gives a message on how to compile one from source code.
|
|
26
|
-
*
|
|
27
|
-
* Set NODE_ORACLEDB_TRACE_INSTALL=TRUE for installation trace output.
|
|
28
|
-
*
|
|
29
|
-
* MAINTENANCE NOTES
|
|
30
|
-
* - This file should run with Node 4 or later.
|
|
31
|
-
* - This file should only ever 'require' packages included in core Node.js.
|
|
32
|
-
*
|
|
33
|
-
*****************************************************************************/
|
|
34
|
-
|
|
35
|
-
'use strict';
|
|
36
|
-
|
|
37
|
-
const http = require('http'); // Fails in old Node.js. Use Node 4+
|
|
38
|
-
const https = require('https');
|
|
39
|
-
const fs = require('fs');
|
|
40
|
-
const url = require('url');
|
|
41
|
-
const packageUtil = require('./util.js');
|
|
42
|
-
const execSync = require('child_process').execSync;
|
|
43
|
-
|
|
44
|
-
packageUtil.initDynamicProps();
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
// Requiring here to ensure it's available, actually used in util.js
|
|
48
|
-
const crypto = require('crypto');
|
|
49
|
-
} catch (err) {
|
|
50
|
-
done(new Error('Node.js crypto module required to install from binary'));
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Note: the Makefile uses these hostname and path values for the npm
|
|
55
|
-
// package but will substitute them for the staging package
|
|
56
|
-
const PACKAGE_HOSTNAME = 'github.com';
|
|
57
|
-
const PACKAGE_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.dynamicProps.PACKAGE_FILE_NAME;
|
|
58
|
-
const SHA_PATH_REMOTE = '/oracle/node-oracledb/releases/download/' + packageUtil.dynamicProps.GITHUB_TAG + '/' + packageUtil.SHA_FILE_NAME;
|
|
59
|
-
const PORT = 443;
|
|
60
|
-
|
|
61
|
-
// readProxyUrl gets the proxy from the environment or npm config.
|
|
62
|
-
// Note getting npm config can be slow on some environments (https://github.com/npm/npm/issues/14458)
|
|
63
|
-
// so setting a proxy environment variable is preferred.
|
|
64
|
-
function readProxyUrl() {
|
|
65
|
-
packageUtil.trace('In readProxyUrl');
|
|
66
|
-
|
|
67
|
-
const envProxy = process.env.https_proxy ||
|
|
68
|
-
process.env.HTTPS_PROXY ||
|
|
69
|
-
process.env.http_proxy ||
|
|
70
|
-
process.env.HTTP_PROXY ||
|
|
71
|
-
process.env.all_proxy ||
|
|
72
|
-
process.env.ALL_PROXY;
|
|
73
|
-
|
|
74
|
-
if (envProxy) {
|
|
75
|
-
return envProxy;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// 'npm config get' can be slow, so call it after checking the env
|
|
79
|
-
// variables: https://github.com/npm/npm/issues/14458
|
|
80
|
-
|
|
81
|
-
const httpsProxy = execSync('npm config get https-proxy').toString().trim();
|
|
82
|
-
|
|
83
|
-
if (httpsProxy !== 'null') {
|
|
84
|
-
return httpsProxy;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const httpProxy = execSync('npm config get proxy').toString().trim();
|
|
88
|
-
|
|
89
|
-
if (httpProxy !== 'null') {
|
|
90
|
-
return httpProxy;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// getProxyConfig gets the proxy configuration for a given hostname.
|
|
97
|
-
// Has basic no_proxy support.
|
|
98
|
-
function getProxyConfig(hostname) {
|
|
99
|
-
packageUtil.trace('In getProxyConfig', hostname);
|
|
100
|
-
|
|
101
|
-
const proxyConfig = {
|
|
102
|
-
useProxy: undefined
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
let proxy = readProxyUrl();
|
|
106
|
-
|
|
107
|
-
if (proxy) {
|
|
108
|
-
proxyConfig.useProxy = true;
|
|
109
|
-
|
|
110
|
-
if (!proxy.startsWith('http://') && !proxy.startsWith('https://')) {
|
|
111
|
-
proxy = 'https://' + proxy;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const parsedUrl = url.parse(proxy);
|
|
115
|
-
|
|
116
|
-
proxyConfig.hostname = parsedUrl.hostname;
|
|
117
|
-
proxyConfig.port = parsedUrl.port;
|
|
118
|
-
proxyConfig.auth = parsedUrl.auth;
|
|
119
|
-
} else {
|
|
120
|
-
proxyConfig.useProxy = false;
|
|
121
|
-
|
|
122
|
-
return proxyConfig;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
const noProxy = process.env.NO_PROXY ||
|
|
126
|
-
process.env.no_PROXY ||
|
|
127
|
-
process.env.no_proxy;
|
|
128
|
-
|
|
129
|
-
if (noProxy === '*') {
|
|
130
|
-
packageUtil.trace('noProxy wildcard');
|
|
131
|
-
proxyConfig.useProxy = false;
|
|
132
|
-
proxyConfig.hostname = undefined;
|
|
133
|
-
proxyConfig.hostname = undefined;
|
|
134
|
-
} else if (noProxy) {
|
|
135
|
-
const noProxies = noProxy.toLowerCase().split(',');
|
|
136
|
-
packageUtil.trace('noProxy', noProxies);
|
|
137
|
-
|
|
138
|
-
if (noProxies.indexOf(hostname.toLowerCase()) > -1) {
|
|
139
|
-
proxyConfig.useProxy = false;
|
|
140
|
-
proxyConfig.hostname = undefined;
|
|
141
|
-
proxyConfig.port = undefined;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return proxyConfig;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// verifyBinary is used to ensure that the SHA of the local binary matches the
|
|
149
|
-
// SHA in the remote SHA file.
|
|
150
|
-
function verifyBinary() {
|
|
151
|
-
return new Promise((resolve, reject) => {
|
|
152
|
-
packageUtil.trace('In verifyBinary');
|
|
153
|
-
packageUtil.trace('Checking for binary at', packageUtil.BINARY_PATH_LOCAL);
|
|
154
|
-
packageUtil.log('Verifying installation');
|
|
155
|
-
|
|
156
|
-
if (!fs.existsSync(packageUtil.BINARY_PATH_LOCAL)) {
|
|
157
|
-
resolve(false);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
let remoteShaFile = '';
|
|
162
|
-
let binarySha;
|
|
163
|
-
|
|
164
|
-
packageUtil.getSha(packageUtil.BINARY_PATH_LOCAL)
|
|
165
|
-
.then((sha) => {
|
|
166
|
-
binarySha = sha;
|
|
167
|
-
|
|
168
|
-
return getRemoteFileReadStream(PACKAGE_HOSTNAME, SHA_PATH_REMOTE);
|
|
169
|
-
})
|
|
170
|
-
.then(readStream => {
|
|
171
|
-
return new Promise((resolve, reject) => {
|
|
172
|
-
readStream.setEncoding('utf8');
|
|
173
|
-
|
|
174
|
-
// Buffer file in memory
|
|
175
|
-
readStream.on('data', chunk => {
|
|
176
|
-
remoteShaFile += chunk;
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
readStream.on('error', reject);
|
|
180
|
-
|
|
181
|
-
readStream.on('end', resolve);
|
|
182
|
-
});
|
|
183
|
-
})
|
|
184
|
-
.then(() => {
|
|
185
|
-
if (!remoteShaFile.match(packageUtil.dynamicProps.BINARY_BUILD_NAME)) {
|
|
186
|
-
packageUtil.log('Build not found in SHASUMS256.txt');
|
|
187
|
-
|
|
188
|
-
resolve(false);
|
|
189
|
-
} else if (!remoteShaFile.match(binarySha + ' ' + packageUtil.dynamicProps.BINARY_BUILD_NAME)) {
|
|
190
|
-
packageUtil.log('Binary SHA does not match SHA in SHASUMS256.txt');
|
|
191
|
-
|
|
192
|
-
resolve(false);
|
|
193
|
-
} else {
|
|
194
|
-
packageUtil.log('Binary SHA matches SHA in SHASUMS256.txt');
|
|
195
|
-
|
|
196
|
-
resolve(true);
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
.catch(reject);
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// The getRemoteFileReadStream function is used as the starting point for
|
|
204
|
-
// fetching remote file streams. It checks the proxy configuration and
|
|
205
|
-
// routes the request to the right function accordingly.
|
|
206
|
-
function getRemoteFileReadStream(hostname, path) {
|
|
207
|
-
packageUtil.trace('In getRemoteFileReadStream', hostname, path);
|
|
208
|
-
|
|
209
|
-
const proxyConfig = getProxyConfig(hostname);
|
|
210
|
-
|
|
211
|
-
if (proxyConfig.useProxy) {
|
|
212
|
-
return getFileReadStreamByProxy(hostname, path, proxyConfig.hostname, proxyConfig.port, proxyConfig.auth);
|
|
213
|
-
} else {
|
|
214
|
-
return getFileReadStreamBase(hostname, path);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// getFileReadStreamByProxy connects to a proxy server before calling getFileReadStreamBase
|
|
219
|
-
// to retrieve a remote file read stream.
|
|
220
|
-
function getFileReadStreamByProxy(hostname, path, proxyHostname, proxyPort, auth) {
|
|
221
|
-
return new Promise((resolve, reject) => {
|
|
222
|
-
packageUtil.trace('In getFileReadStreamByProxy', hostname, path, proxyHostname, proxyPort);
|
|
223
|
-
|
|
224
|
-
let headers = {
|
|
225
|
-
'host': hostname + ':' + PORT
|
|
226
|
-
};
|
|
227
|
-
if (auth) {
|
|
228
|
-
headers['Proxy-Authorization'] = 'Basic ' + new Buffer(auth).toString('base64');
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Open a proxy tunnel
|
|
232
|
-
const req = http.request({
|
|
233
|
-
host: proxyHostname,
|
|
234
|
-
port: proxyPort,
|
|
235
|
-
method: 'CONNECT',
|
|
236
|
-
path: hostname + ':' + PORT,
|
|
237
|
-
headers: headers
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
req.on('error', reject);
|
|
241
|
-
|
|
242
|
-
// When this ends, the transfer will be complete
|
|
243
|
-
req.end();
|
|
244
|
-
|
|
245
|
-
req.on('connect', function(res, socket) {
|
|
246
|
-
if (res.statusCode >= 300 && res.statusCode < 400) { // warning: proxy redirection code is untested
|
|
247
|
-
const redirectUrl = url.parse(res.headers.location);
|
|
248
|
-
|
|
249
|
-
proxyHostname = redirectUrl.hostname;
|
|
250
|
-
proxyPort = redirectUrl.port;
|
|
251
|
-
|
|
252
|
-
return getFileReadStreamByProxy(hostname, path, proxyHostname, proxyPort, auth);
|
|
253
|
-
} else if (res.statusCode !== 200) {
|
|
254
|
-
reject(new Error('Error: HTTP proxy request for ' + hostname + path + ' failed with code ' + res.statusCode));
|
|
255
|
-
return;
|
|
256
|
-
} else {
|
|
257
|
-
getFileReadStreamBase(hostname, path, socket)
|
|
258
|
-
.then(fileReadStream => {
|
|
259
|
-
resolve(fileReadStream);
|
|
260
|
-
})
|
|
261
|
-
.catch(reject);
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// The getFileReadStreamBase function is the main function that retrieves a remote
|
|
268
|
-
// file read stream.
|
|
269
|
-
function getFileReadStreamBase(hostname, path, socket) {
|
|
270
|
-
return new Promise((resolve, reject) => {
|
|
271
|
-
packageUtil.trace('In getFileReadStreamBase', hostname, path);
|
|
272
|
-
|
|
273
|
-
let settled = false;
|
|
274
|
-
|
|
275
|
-
const req = https.get(
|
|
276
|
-
{
|
|
277
|
-
host: hostname,
|
|
278
|
-
path: path,
|
|
279
|
-
socket: socket
|
|
280
|
-
},
|
|
281
|
-
function(res) {
|
|
282
|
-
packageUtil.trace('HTTP statusCode =', res.statusCode);
|
|
283
|
-
|
|
284
|
-
if (res.statusCode >= 300 && res.statusCode < 400) {
|
|
285
|
-
const redirectUrl = url.parse(res.headers.location);
|
|
286
|
-
const newHostname = redirectUrl.hostname;
|
|
287
|
-
const newPath = redirectUrl.pathname + redirectUrl.search;
|
|
288
|
-
|
|
289
|
-
getRemoteFileReadStream(newHostname, newPath)
|
|
290
|
-
.then(res => {
|
|
291
|
-
if (!settled) {
|
|
292
|
-
resolve(res);
|
|
293
|
-
settled = true;
|
|
294
|
-
}
|
|
295
|
-
})
|
|
296
|
-
.catch(err => {
|
|
297
|
-
if (!settled) {
|
|
298
|
-
reject(err);
|
|
299
|
-
settled = true;
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
} else if (res.statusCode !== 200) {
|
|
303
|
-
if (!settled) {
|
|
304
|
-
reject(new Error('Error: HTTPS request for https://' + hostname + path + ' failed with code ' + res.statusCode));
|
|
305
|
-
settled = true;
|
|
306
|
-
}
|
|
307
|
-
} else {
|
|
308
|
-
if (!settled) {
|
|
309
|
-
resolve(res);
|
|
310
|
-
settled = true;
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
);
|
|
315
|
-
|
|
316
|
-
req.on('error', err => {
|
|
317
|
-
if (!settled) {
|
|
318
|
-
reject(err);
|
|
319
|
-
settled = true;
|
|
320
|
-
}
|
|
321
|
-
});
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// installBinary creates the directories for the binary, downloads the custom
|
|
326
|
-
// file, and then extracts the license and the binary.
|
|
327
|
-
function installBinary() {
|
|
328
|
-
return new Promise((resolve, reject) => {
|
|
329
|
-
packageUtil.trace('In installBinary at: "' + process.cwd() + '" mode: ' + fs.statSync(process.cwd()).mode);
|
|
330
|
-
|
|
331
|
-
// Directories to be created for the binary
|
|
332
|
-
const dirs = [
|
|
333
|
-
'build',
|
|
334
|
-
'build/Release'
|
|
335
|
-
];
|
|
336
|
-
|
|
337
|
-
// Create relative binary directory
|
|
338
|
-
try {
|
|
339
|
-
dirs.forEach(function(p) {
|
|
340
|
-
if (!fs.existsSync(p)) {
|
|
341
|
-
fs.mkdirSync(p);
|
|
342
|
-
fs.chmodSync(p, '0755');
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
} catch(err) {
|
|
346
|
-
if (err) {
|
|
347
|
-
reject(err);
|
|
348
|
-
return;
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// Get the binary
|
|
353
|
-
getRemoteFileReadStream(PACKAGE_HOSTNAME, PACKAGE_PATH_REMOTE)
|
|
354
|
-
.then(compressedReadstream => {
|
|
355
|
-
return packageUtil.extract({
|
|
356
|
-
licenseDest: packageUtil.LICENSE_PATH_LOCAL,
|
|
357
|
-
writeLicense: true,
|
|
358
|
-
binaryDest: packageUtil.BINARY_PATH_LOCAL,
|
|
359
|
-
compressedReadstream: compressedReadstream
|
|
360
|
-
});
|
|
361
|
-
})
|
|
362
|
-
.then(() => {
|
|
363
|
-
fs.chmodSync(packageUtil.BINARY_PATH_LOCAL, '0755');
|
|
364
|
-
|
|
365
|
-
resolve();
|
|
366
|
-
})
|
|
367
|
-
.catch(err => {
|
|
368
|
-
reject(err);
|
|
369
|
-
});
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
// The done function is used to print concluding messages and quit.
|
|
374
|
-
function done(err, alreadyInstalled) {
|
|
375
|
-
const installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html';
|
|
376
|
-
|
|
377
|
-
if (err) {
|
|
378
|
-
packageUtil.error('NJS-054: Binary build/Release/oracledb.node was not installed.');
|
|
379
|
-
if (['darwin', 'win32', 'linux'].indexOf(process.platform) < 0) {
|
|
380
|
-
packageUtil.error('Pre-built binary packages are not available for platform="' + process.platform + '"');
|
|
381
|
-
} else if (process.arch !== 'x64') {
|
|
382
|
-
packageUtil.error('Pre-built binary packages are not available for architecture="' + process.arch + '"');
|
|
383
|
-
} else if (['48', '57', '64'].indexOf(process.versions.modules) < 0) {
|
|
384
|
-
packageUtil.error('Pre-built binary packages are not available for this version of Node.js (NODE_MODULE_VERSION="' + process.versions.modules + '")');
|
|
385
|
-
}
|
|
386
|
-
packageUtil.error('Failed to install binary package ' + packageUtil.dynamicProps.PACKAGE_FILE_NAME);
|
|
387
|
-
packageUtil.error(err.message);
|
|
388
|
-
packageUtil.error('For help see ' + installUrl + '#troubleshooting\n');
|
|
389
|
-
process.exit(87);
|
|
390
|
-
} else {
|
|
391
|
-
let arch;
|
|
392
|
-
let clientUrl;
|
|
393
|
-
|
|
394
|
-
if (process.arch === 'x64') {
|
|
395
|
-
arch = '64-bit';
|
|
396
|
-
} else {
|
|
397
|
-
arch = '32-bit';
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
packageUtil.log('');
|
|
401
|
-
packageUtil.log('********************************************************************************');
|
|
402
|
-
|
|
403
|
-
if (alreadyInstalled) {
|
|
404
|
-
packageUtil.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' was already installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
|
|
405
|
-
} else {
|
|
406
|
-
packageUtil.log('** Node-oracledb ' + packageUtil.dynamicProps.PACKAGE_JSON_VERSION + ' installation complete for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
packageUtil.log('**');
|
|
410
|
-
packageUtil.log('** To use the installed node-oracledb:');
|
|
411
|
-
|
|
412
|
-
if (process.platform === 'linux') {
|
|
413
|
-
if (process.arch === 'x64') {
|
|
414
|
-
clientUrl = 'http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html';
|
|
415
|
-
} else {
|
|
416
|
-
clientUrl = 'http://www.oracle.com/technetwork/topics/linuxsoft-082809.html';
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig');
|
|
420
|
-
packageUtil.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from ');
|
|
421
|
-
packageUtil.log('** ' + clientUrl);
|
|
422
|
-
} else if (process.platform === 'darwin') {
|
|
423
|
-
clientUrl = 'http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
|
|
424
|
-
|
|
425
|
-
packageUtil.log('** - You need to have the Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib');
|
|
426
|
-
packageUtil.log('** Download from ' + clientUrl);
|
|
427
|
-
} else if (process.platform === 'win32') {
|
|
428
|
-
if (process.arch === 'x64') {
|
|
429
|
-
clientUrl = 'http://www.oracle.com/technetwork/topics/winx64soft-089540.html';
|
|
430
|
-
} else {
|
|
431
|
-
clientUrl = 'http://www.oracle.com/technetwork/topics/winsoft-085727.html';
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in your PATH environment variable');
|
|
435
|
-
packageUtil.log('** - If you do not already have libraries, install the Instant Client Basic or Basic Light package from');
|
|
436
|
-
packageUtil.log('** ' + clientUrl);
|
|
437
|
-
packageUtil.log('** - A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available');
|
|
438
|
-
packageUtil.log('** Check ' + installUrl + ' for details');
|
|
439
|
-
} else {
|
|
440
|
-
clientUrl = 'http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html';
|
|
441
|
-
|
|
442
|
-
packageUtil.log('** - You must have ' + arch + ' Oracle client libraries in your operating system library search path');
|
|
443
|
-
packageUtil.log('** - If you do not already have libraries, install an Instant Client Basic or Basic Light package from: ');
|
|
444
|
-
packageUtil.log('** ' + clientUrl);
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
packageUtil.log('**');
|
|
448
|
-
packageUtil.log('** Node-oracledb installation instructions: ' + installUrl);
|
|
449
|
-
packageUtil.log('********************************************************************************\n');
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
// The install function is the main function that installs the binary.
|
|
454
|
-
function install() {
|
|
455
|
-
packageUtil.trace('In install');
|
|
456
|
-
|
|
457
|
-
const nodeMajorVersion = Number(process.version.split('.')[0].replace(/^v/, ''));
|
|
458
|
-
|
|
459
|
-
if (!nodeMajorVersion >= 4) {
|
|
460
|
-
done(new Error('Node.js v4.0.0 or higher is required to install from binary'));
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
packageUtil.log('Beginning installation');
|
|
465
|
-
|
|
466
|
-
verifyBinary() // check if download is necessary for 'npm rebuild'
|
|
467
|
-
.then((valid) => {
|
|
468
|
-
if (valid) {
|
|
469
|
-
done(null, true);
|
|
470
|
-
} else {
|
|
471
|
-
packageUtil.log('Continuing installation');
|
|
472
|
-
|
|
473
|
-
return new Promise((resolve, reject) => {
|
|
474
|
-
installBinary()
|
|
475
|
-
.then(() => {
|
|
476
|
-
packageUtil.log('Oracledb downloaded');
|
|
477
|
-
|
|
478
|
-
return verifyBinary();
|
|
479
|
-
})
|
|
480
|
-
.then(valid => {
|
|
481
|
-
if (valid) {
|
|
482
|
-
done(null, false);
|
|
483
|
-
resolve();
|
|
484
|
-
} else {
|
|
485
|
-
reject(new Error('Verification failed'));
|
|
486
|
-
}
|
|
487
|
-
})
|
|
488
|
-
.catch(reject);
|
|
489
|
-
});
|
|
490
|
-
}
|
|
491
|
-
})
|
|
492
|
-
.catch(err => {
|
|
493
|
-
done(err, false);
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
install();
|
package/package/package.json
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "oracledb",
|
|
3
|
-
"version": "3.0.0",
|
|
4
|
-
"description": "A Node.js module for Oracle Database access",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"homepage": "http://oracle.github.io/node-oracledb/",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"Oracle",
|
|
9
|
-
"Database",
|
|
10
|
-
"official",
|
|
11
|
-
"DB",
|
|
12
|
-
"SQL",
|
|
13
|
-
"JSON",
|
|
14
|
-
"PL/SQL",
|
|
15
|
-
"OCI",
|
|
16
|
-
"API",
|
|
17
|
-
"client",
|
|
18
|
-
"library",
|
|
19
|
-
"driver",
|
|
20
|
-
"add-on",
|
|
21
|
-
"extension",
|
|
22
|
-
"binding",
|
|
23
|
-
"interface",
|
|
24
|
-
"adapter",
|
|
25
|
-
"module"
|
|
26
|
-
],
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "git://github.com/oracle/node-oracledb.git"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"mocha": "^2.4.5",
|
|
33
|
-
"should": "^8.3.1",
|
|
34
|
-
"async": "^1.5.0"
|
|
35
|
-
},
|
|
36
|
-
"scripts": {
|
|
37
|
-
"install": "node package/oracledbinstall.js",
|
|
38
|
-
"testv6": "mocha --opts test/opts/mochaNodeV6.opts",
|
|
39
|
-
"test": "mocha --opts test/opts/mocha.opts",
|
|
40
|
-
"posttest": "node test/opts/version.js"
|
|
41
|
-
},
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": ">=4"
|
|
44
|
-
},
|
|
45
|
-
"maintainers": [
|
|
46
|
-
{
|
|
47
|
-
"name": "Oracle Corp."
|
|
48
|
-
}
|
|
49
|
-
],
|
|
50
|
-
"bugs": {
|
|
51
|
-
"url": "https://github.com/oracle/node-oracledb/issues"
|
|
52
|
-
},
|
|
53
|
-
"main": "./index.js"
|
|
54
|
-
}
|