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/lib/util.js CHANGED
@@ -1,4 +1,4 @@
1
- /* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. */
1
+ /* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. */
2
2
 
3
3
  /******************************************************************************
4
4
  *
@@ -21,14 +21,25 @@
21
21
 
22
22
  var util = require('util');
23
23
 
24
+ // Directory containing the node-oracledb add-on binary
25
+ const RELEASE_DIR = 'build/Release';
26
+ module.exports.RELEASE_DIR = RELEASE_DIR;
27
+
28
+ // The default node-oracledb add-on binary filename for this Node.js
29
+ const BINARY_FILE = 'oracledb-abi' + process.versions.modules + '-' + process.platform + '-' + process.arch + '.node';
30
+ module.exports.BINARY_FILE = BINARY_FILE;
31
+
32
+ // Staging directory used by maintainers building the npm package
33
+ const STAGING_DIR = 'package/Staging';
34
+ module.exports.STAGING_DIR = STAGING_DIR;
35
+
24
36
  var EventEmitter = require('events').EventEmitter;
25
37
  var eventEmitterKeys = Object.keys(EventEmitter.prototype);
26
38
  var eventEmitterFuncKeys = eventEmitterKeys.filter(function(key) {
27
39
  return typeof EventEmitter.prototype[key] === 'function';
28
40
  });
29
41
 
30
- // errorMessages is a temporary duplication of error messages defined in the C
31
- // layer that will be removed once a function to fetch from the C layer is added.
42
+ // errorMessages is for NJS error messages used in the JavaScript layer
32
43
  var errorMessages = {
33
44
  'NJS-002': 'NJS-002: invalid pool',
34
45
  'NJS-004': 'NJS-004: invalid value for property %s',
@@ -41,13 +52,79 @@ var errorMessages = {
41
52
  'NJS-041': 'NJS-041: cannot convert ResultSet to QueryStream after invoking methods',
42
53
  'NJS-042': 'NJS-042: cannot invoke ResultSet methods after converting to QueryStream',
43
54
  'NJS-043': 'NJS-043: ResultSet already converted to QueryStream',
44
- 'NJS-045': 'NJS-045: cannot load the oracledb add-on binary for Node.js %s',
55
+ 'NJS-045': 'NJS-045: cannot load a node-oracledb binary for Node.js ' + process.versions.node + ' (' + process.platform + ' ' + process.arch + ') %s',
45
56
  'NJS-046': 'NJS-046: poolAlias "%s" already exists in the connection pool cache',
46
57
  'NJS-047': 'NJS-047: poolAlias "%s" not found in the connection pool cache',
58
+ 'NJS-054': 'NJS-054: binary build/Release/oracledb.node was not installed',
47
59
  'NJS-064': 'NJS-064: connection pool is closing',
48
- 'NJS-065': 'NJS-065: connection pool was closed'
60
+ 'NJS-065': 'NJS-065: connection pool was closed',
61
+ 'NJS-067': 'NJS-067: a pre-built node-oracledb binary was not found for Node.js %s'
49
62
  };
50
63
 
64
+ // getInstallURL returns a string with installation URL
65
+ function getInstallURL() {
66
+ return('Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html');
67
+ }
68
+
69
+ module.exports.getInstallURL = getInstallURL;
70
+
71
+ // getInstallHelp returns a string with installation usage tips that may be helpful
72
+ function getInstallHelp() {
73
+ var arch, url;
74
+ var mesg = getInstallURL() + '\n';
75
+ if (process.platform === 'linux') {
76
+ if (process.arch === 'x64') {
77
+ url = 'http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html\n';
78
+ arch = '64-bit';
79
+ } else if (process.arch === 'x32') {
80
+ url = 'http://www.oracle.com/technetwork/topics/linuxsoft-082809.html\n';
81
+ arch = '32-bit';
82
+ } else {
83
+ url = 'http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html\n';
84
+ arch = process.arch;
85
+ }
86
+ mesg += 'You must have ' + arch + ' Oracle client libraries in LD_LIBRARY_PATH, or configured with ldconfig.\n';
87
+ mesg += 'If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from \n';
88
+ mesg += url;
89
+ } else if (process.platform === 'darwin') {
90
+ if (process.arch === 'x64') {
91
+ url = 'http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
92
+ arch = '64-bit';
93
+ } else if (process.arch === 'x32') {
94
+ url = 'http://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
95
+ arch = '32-bit';
96
+ } else {
97
+ url = 'http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html\n';
98
+ arch = process.arch;
99
+ }
100
+ mesg += 'You must have the ' + arch + ' Oracle Instant Client Basic or Basic Light package in ~/lib or /usr/local/lib\n';
101
+ mesg += 'They can be downloaded from ' + url;
102
+ } else if (process.platform === 'win32') {
103
+ if (process.arch === 'x64') {
104
+ url = 'http://www.oracle.com/technetwork/topics/winx64soft-089540.html\n';
105
+ arch = '64-bit';
106
+ } else if (process.arch === 'x32') {
107
+ url = 'http://www.oracle.com/technetwork/topics/winsoft-085727.html\n';
108
+ arch = '32-bit';
109
+ } else {
110
+ url = 'http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html\n';
111
+ arch = process.arch;
112
+ }
113
+ mesg += 'You must have ' + arch + ' Oracle client libraries in your PATH environment variable.\n';
114
+ mesg += 'If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from\n';
115
+ mesg += url;
116
+ mesg += 'A Microsoft Visual Studio Redistributable suitable for your Oracle client library version must be available.\n';
117
+ } else {
118
+ url = 'http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html\n';
119
+ mesg += 'You must have ' + process.arch + ' Oracle client libraries in your operating system library search path.\n';
120
+ mesg += 'If you do not have Oracle Database on this computer, then install an Instant Client Basic or Basic Light package from: \n';
121
+ mesg += url;
122
+ }
123
+ return mesg;
124
+ }
125
+
126
+ module.exports.getInstallHelp = getInstallHelp;
127
+
51
128
  // makeEventEmitter is used to make class instances inherit from the EventEmitter
52
129
  // class. This is needed because we extend instances from the C layer and thus
53
130
  // don't have JavaScript constructor functions we can use for more traditional
package/package/README.md CHANGED
@@ -1,115 +1,46 @@
1
1
  # Overview
2
2
 
3
- This directory contains scripts for building, extracting and
4
- installing binary packages of node-oracledb. Most users do not need
5
- to use anything in this directory (the exceptions are when building
6
- packages for self-hosting, or when doing a [manual
7
- install](https://oracle.github.io/node-oracledb/INSTALL.html#manualextraction)
8
- instead of using `npm`).
3
+ This directory is used for building the [node-oracledb npm
4
+ package](https://www.npmjs.com/package/oracledb). The scripts can
5
+ also be used to create custom packages for hosting on a local server.
9
6
 
10
- The binary install process requires two kinds of package:
11
-
12
- - a gzipped tar file like `oracledb-X.Y.Z.tgz` containing JavaScript
13
- and ancillary files suitable for npm to install. This is a generic
14
- file used on all platforms.
15
-
16
- - a gzipped package like `oracledb-vZ.Y.Z-node-abi57-darwin-x64.gz`
17
- containing the binary add-on. The package uses a custom format with
18
- three components: length bytes (giving the length of the license
19
- file), the license file, and then the node-oracledb binary. Each
20
- Node.js version/architecture needs a unique binary package.
21
-
22
- A custom package format is used due to business and technical requirements:
23
-
24
- - the license text needs to be included with any binary download.
25
-
26
- - Node.js doesn't have a native archive module, and the installer
27
- should be lightweight and not have 3rd party dependencies.
28
-
29
- When `npm install oracledb` is executed, the JavaScript package is
30
- first installed by npm. An 'install' script in its `package.json`
31
- invokes `oracledbinstall.js`. This downloads the appropriate
32
- node-oracledb binary package, and then extracts and installs the
33
- binary.
34
-
35
- If a suitable binary package is not available, users must compile
36
- source code by installing from GitHub.
37
-
38
- Installation is described in [INSTALL](https://oracle.github.io/node-oracledb/INSTALL.html).
7
+ Most users do not need to use anything in this directory.
39
8
 
40
9
  # Maintainers
41
10
 
42
- - The Makefile is used by node-oracledb maintainers to create the
43
- packages to be uploaded to
44
- [GitHub](https://github.com/oracle/node-oracledb) and
45
- [npm](https://www.npmjs.com/package/oracledb).
46
-
47
- - `make npmpackage` makes the main node-oracledb package
48
- containing the general node-oracledb JavaScript files and the
49
- package.json in this directory. This is the package that an
50
- `npm install oracledb` will initially install.
51
-
52
- - `make binarypackage` makes a binary package for the current
53
- Node.js / node-oracledb / platform combination and generates a
54
- SHA256 for the binary. A Windows batch file does the same for
55
- Windows.
56
-
57
- - As part of `npm install`, the `package.json` in this directory
58
- invokes `oracledbinstall.js` that downloads the appropriate binary
59
- package from GitHub. This variant of `package.json` is the copy
60
- bundled for the npm release.
61
-
62
- The parent file `../package.json` doesn't have the install target
63
- meaning that node-gyp will be invoked to compile node-oracledb. This
64
- allows installation from source code (via GitHub) when no suitable
65
- pre-built binary is available.
66
-
67
- - The `make npmpackage` command creates three variants of the JavaScript bundle:
68
-
69
- - `oracledb-X.Y.Z.tgz` which downloads binaries from the
70
- node-oracledb GitHub release page.
71
-
72
- - `staging-oracledb-X.Y.Z.tgz` which downloads binaries from a
73
- server of your choice, specified by the environment variables
74
- `NODE_ORACLEDB_PACKAGE_HOSTNAME` (e.g. "your.example.com") and
75
- `NODE_ORACLEDB_PACKAGE_URL_PATH` (e.g. "/yourpath/") which must be set
76
- before running `make`.
77
-
78
- - `oracledb-src-X.Y.Z.tgz` which is the complete source code, mainly
79
- created because older npm's (e.g. with Node.js 4) do not download the
80
- opdi submodule code when installing from a GitHub tag or branch.
81
-
82
- - The`staging-oracledb-X.Y.Z.tgz` package can be used to host binaries
83
- on internal networks. Copy `staging-oracledb-X.Y.Z.tgz`, the binary
84
- packages for each desired architectures, and a single SHASUMS256.txt
85
- file (with one line per available binary package) to an
86
- HTTPS-enabled web server to the directory that
87
- https://your.example.com/yourpath/vX.Y.Z/ resolves to. Note if the
88
- web server has a self-signed certificate, then you may need to
89
- bypass some npm checks:
11
+ In a clone or copy of the repository:
90
12
 
91
- ```
92
- export NODE_TLS_REJECT_UNAUTHORIZED=0
93
- npm config set strict-ssl false
13
+ - `npm run buildbinary` calls `buildbinary.js` to create a binary for
14
+ the current node-oracledb / Node.js / platform combination.
94
15
 
95
- npm install https://your.example.com/yourpath/vX.Y.Z/staging-oracledb-X.Y.X.tgz
96
- ```
16
+ - `npm run buildpackage` calls `buildpackage.js` to make the
17
+ node-oracledb package containing the node-oracledb JavaScript files,
18
+ the available binaries, and a package.json that has an "install"
19
+ script and a "prune" script. The package will be created in the top
20
+ level directory.
97
21
 
98
- Remember to do `npm config delete strict-ssl` and unset the
99
- environment variable when not testing.
22
+ Before executing `npm run buildpackage`, all binaries and related
23
+ build metadata information files from all node-oracledb / Node.js /
24
+ platform combinations should be placed in the `package/Staging`
25
+ directory.
100
26
 
101
- - On Windows, MAKEPKG.BAT has command options to create binaries, and
102
- also to create staged binaries and the main packages.
27
+ Package installation:
103
28
 
104
- - At install time, setting the environment variable
105
- `NODE_ORACLEDB_TRACE_INSTALL` to `TRUE` will cause `npm install` to
106
- display more tracing information.
29
+ - As part of an `npm install` that uses the created package, the
30
+ `package.json` install script runs `package/install.js` to check a
31
+ binary module for the current Node.js and platform is available.
107
32
 
108
- - The installer scripts assume GitHub tags have the format "vX.Y.Z".
109
- Other assumptions about GitHub paths are also made in the scripts.
33
+ If a suitable binary is not available, installation will fail.
34
+ Users must then compile node-oracledb using source code from GitHub,
35
+ or choose an alternative Node.js / platform that has a pre-built
36
+ binary module.
110
37
 
111
- - TODO
38
+ - After install, space conscious users can run `npm run prune` which
39
+ removes pre-built binaries for all other Node.js releases and
40
+ architectures.
112
41
 
113
- - oracledbinstall.js should cache SHASUMS256.txt so it doesn't have to be fetched twice.
114
- - Add support for proxies that require authentication
115
- - Improve oracledbinstall.js `no_proxy` support for domain names and wildcards.
42
+ By default the top level `package.json` doesn't have an install script
43
+ target. This means that node-gyp will be invoked to compile
44
+ node-oracledb. This allows installation from [source
45
+ code](https://oracle.github.io/node-oracledb/INSTALL.html#github) (via
46
+ GitHub) when no suitable pre-built binary is available.
@@ -0,0 +1,139 @@
1
+ /* Copyright (c) 2017, 2019, 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
+ * install.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.
24
+ *
25
+ * The node-oracledb npm package bundles all available pre-built
26
+ * binaries, so this script is really just a check to see if an
27
+ * appropriate pre-built binary is available.
28
+ *
29
+ * MAINTENANCE NOTES
30
+ * This file should only ever 'require' packages included in core Node.js.
31
+ *
32
+ *****************************************************************************/
33
+
34
+ 'use strict';
35
+
36
+ const fs = require('fs');
37
+ const nodbUtil = require('../lib/util.js');
38
+
39
+ let packageJSON;
40
+ try {
41
+ packageJSON = require('../package.json');
42
+ } catch(err) {
43
+ throw new Error('package.json is missing');
44
+ }
45
+ const PACKAGE_JSON_VERSION = packageJSON.version;
46
+
47
+ // Log standard output with an 'oracledb' prefix
48
+ function log(message) { // eslint-disable-line
49
+ const args = Array.from(arguments);
50
+ args.unshift('oracledb');
51
+ console.log.apply(console, args);
52
+ }
53
+
54
+ // Log errors. It combines 'oracledb' with a stylized 'ERR' prefix
55
+ function error(message) { // eslint-disable-line
56
+ const args = Array.from(arguments);
57
+ args.unshift('oracledb \x1b[31mERR!\x1b[0m');
58
+ console.error.apply(console, args);
59
+ }
60
+
61
+ // Print a concluding messages and quits
62
+ function done(err) {
63
+ let installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html';
64
+
65
+ if (err) { // Couldn't install the binary
66
+ error(err.message);
67
+ error('Try compiling node-oracledb source code using ' + installUrl + '#github');
68
+ process.exit(87);
69
+ } else { // Successfully installed
70
+ let arch;
71
+ let clientUrl;
72
+
73
+ if (process.arch === 'x64') {
74
+ arch = '64-bit';
75
+ } else {
76
+ arch = '32-bit';
77
+ }
78
+
79
+ log('********************************************************************************');
80
+
81
+ log('** Node-oracledb ' + PACKAGE_JSON_VERSION + ' installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
82
+
83
+ log('**');
84
+ log('** To use node-oracledb:');
85
+
86
+ if (process.platform === 'linux') {
87
+ if (process.arch === 'x64') {
88
+ clientUrl = 'https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html';
89
+ } else {
90
+ clientUrl = 'https://www.oracle.com/technetwork/topics/linuxsoft-082809.html';
91
+ }
92
+
93
+ log('** - Oracle Client libraries (' + arch + ') must be configured with ldconfig or LD_LIBRARY_PATH');
94
+ log('** - To get libraries, install an Instant Client Basic or Basic Light package from');
95
+ log('** ' + clientUrl);
96
+ } else if (process.platform === 'darwin') {
97
+ clientUrl = 'https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
98
+ installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html#instosx';
99
+
100
+ log('** - An Oracle Instant Client Basic or Basic Light package must be in ~/lib or /usr/local/lib');
101
+ log('** Download from ' + clientUrl);
102
+ } else if (process.platform === 'win32') {
103
+ if (process.arch === 'x64') {
104
+ clientUrl = 'https://www.oracle.com/technetwork/topics/winx64soft-089540.html';
105
+ } else {
106
+ clientUrl = 'https://www.oracle.com/technetwork/topics/winsoft-085727.html';
107
+ }
108
+
109
+ log('** - Oracle Client libraries (' + arch + ') must be in your PATH environment variable');
110
+ log('** - To get libraries, install an Instant Client Basic or Basic Light package from');
111
+ log('** ' + clientUrl);
112
+ log('** - A Microsoft Visual Studio Redistributable suitable for your Oracle Client library version must be available');
113
+ log('** See ' + installUrl + ' for details');
114
+ } else {
115
+ clientUrl = 'https://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html';
116
+ log('** - Oracle Client libraries (' + arch + ') must be in your operating system library search path');
117
+ log('** - To get libraries, install an Instant Client Basic or Basic Light package from:');
118
+ log('** ' + clientUrl);
119
+ }
120
+
121
+ log('**');
122
+ log('** Installation instructions: ' + installUrl);
123
+ log('********************************************************************************\n');
124
+ }
125
+ }
126
+
127
+ // Check there is a usable binary file for the node-oracledb module
128
+ function checkAvailable(cb) {
129
+ const binaryFile = nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE;
130
+ try {
131
+ fs.statSync(binaryFile);
132
+ cb();
133
+ } catch (err) {
134
+ let m = process.version + ' (NODE_MODULE_VERSION=' + process.versions.modules + ') on ' + process.platform + ' ' + process.arch;
135
+ cb(new Error(nodbUtil.getErrorMessage('NJS-067', m)));
136
+ }
137
+ }
138
+
139
+ checkAvailable(done);
@@ -0,0 +1,51 @@
1
+ /* Copyright (c) 2019, 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
+ * prunebinaries.js
20
+ *
21
+ * DESCRIPTION
22
+ * Removes pre-built binaries for all other Node.js releases and architectures.
23
+ * It keeps only the binary for the current Node.js version and architecture.
24
+ * This can be used to reduce the footprint of a node-oracledb install.
25
+ *
26
+ * USAGE
27
+ * Invoke this from the top level directory.
28
+ * After an 'npm install oracledb' installs pre-built binaries it
29
+ * can be run with 'npm run prune'.
30
+ *
31
+ *****************************************************************************/
32
+
33
+ 'use strict';
34
+
35
+ const fs = require('fs');
36
+ const nodbUtil = require('../lib/util.js');
37
+
38
+ const dir = nodbUtil.RELEASE_DIR;
39
+
40
+ let re = new RegExp(nodbUtil.BINARY_FILE);
41
+
42
+ try {
43
+ let f = fs.readdirSync(dir);
44
+ for (let i = 0; i < f.length; i++) {
45
+ if (!f[i].match(re) && (f[i].match(/oracledb.*\.node(-buildinfo.txt)*/))) {
46
+ fs.unlinkSync(dir + '/' + f[i]);
47
+ }
48
+ }
49
+ } catch(err) {
50
+ console.error(err.message);
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "3.0.0",
3
+ "version": "3.1.2",
4
4
  "description": "A Node.js module for Oracle Database access",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "http://oracle.github.io/node-oracledb/",
@@ -28,19 +28,12 @@
28
28
  "type": "git",
29
29
  "url": "git://github.com/oracle/node-oracledb.git"
30
30
  },
31
- "devDependencies": {
32
- "mocha": "^2.4.5",
33
- "should": "^8.3.1",
34
- "async": "^1.5.0"
35
- },
36
31
  "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"
32
+ "install": "node package/install.js",
33
+ "prune": "node package/prunebinaries.js"
41
34
  },
42
35
  "engines": {
43
- "node": ">=4"
36
+ "node": ">=6"
44
37
  },
45
38
  "maintainers": [
46
39
  {
package/binding.gyp DELETED
@@ -1,162 +0,0 @@
1
- {
2
- "targets": [
3
- {
4
- "target_name" : "oracledb",
5
- "sources" : [
6
- "src/njsCommon.cpp",
7
- "src/njsOracle.cpp",
8
- "src/njsPool.cpp",
9
- "src/njsConnection.cpp",
10
- "src/njsResultSet.cpp",
11
- "src/njsSubscription.cpp",
12
- "src/njsMessages.cpp",
13
- "src/njsIntLob.cpp",
14
- "src/njsSodaDatabase.cpp",
15
- "src/njsSodaCollection.cpp",
16
- "src/njsSodaDocument.cpp",
17
- "src/njsSodaOperation.cpp",
18
- "src/njsSodaDocCursor.cpp",
19
- "src/njsUtils.cpp",
20
- "odpi/src/dpiConn.c",
21
- "odpi/src/dpiContext.c",
22
- "odpi/src/dpiData.c",
23
- "odpi/src/dpiDebug.c",
24
- "odpi/src/dpiDeqOptions.c",
25
- "odpi/src/dpiEnqOptions.c",
26
- "odpi/src/dpiEnv.c",
27
- "odpi/src/dpiError.c",
28
- "odpi/src/dpiGen.c",
29
- "odpi/src/dpiGlobal.c",
30
- "odpi/src/dpiHandleList.c",
31
- "odpi/src/dpiHandlePool.c",
32
- "odpi/src/dpiLob.c",
33
- "odpi/src/dpiMsgProps.c",
34
- "odpi/src/dpiObjectAttr.c",
35
- "odpi/src/dpiObject.c",
36
- "odpi/src/dpiObjectType.c",
37
- "odpi/src/dpiOci.c",
38
- "odpi/src/dpiOracleType.c",
39
- "odpi/src/dpiPool.c",
40
- "odpi/src/dpiRowid.c",
41
- "odpi/src/dpiSodaColl.c",
42
- "odpi/src/dpiSodaCollCursor.c",
43
- "odpi/src/dpiSodaDb.c",
44
- "odpi/src/dpiSodaDoc.c",
45
- "odpi/src/dpiSodaDocCursor.c",
46
- "odpi/src/dpiStmt.c",
47
- "odpi/src/dpiSubscr.c",
48
- "odpi/src/dpiUtils.c",
49
- "odpi/src/dpiVar.c"
50
- ],
51
- "conditions" : [
52
- [
53
- 'OS=="linux"', {
54
- "variables" : {
55
- "dpi_check%" : "<!(INSTURL=\"https://oracle.github.io/node-oracledb/INSTALL.html#github\"; ERR=\"oracledb ERR! Error:\"; if [ -f odpi/include/dpi.h ]; then echo \"Has dpi.h\"; else echo \"$ERR Cannot find odpi/include/dpi.h. For GitHub ZIP downloads you must separately download the odpi subdirectory from GitHub.\" >&2; echo \"$ERR See $INSTURL\" >&2; echo \"\" >&2; fi;)"
56
- },
57
- "cflags" : ['-fexceptions'],
58
- "cflags_cc" : ['-fexceptions'],
59
- "libraries" : ['-ldl', '-lpthread'],
60
- }
61
- ],
62
- [
63
- 'OS=="mac"', {
64
- "variables" : {
65
- "dpi_check%" : "<!(INSTURL=\"https://oracle.github.io/node-oracledb/INSTALL.html#github\"; ERR=\"oracledb ERR! Error:\"; if [ -f odpi/include/dpi.h ]; then echo \"Has dpi.h\"; else echo \"$ERR Cannot find odpi/include/dpi.h. For GitHub ZIP downloads you must separately download the odpi subdirectory from GitHub.\" >&2; echo \"$ERR See $INSTURL\" >&2; echo \"\" >&2; fi;)"
66
- },
67
- "xcode_settings": {
68
- "GCC_ENABLE_CPP_EXCEPTIONS": "YES",
69
- "GCC_ENABLE_CPP_RTTI": "YES"
70
- },
71
- "libraries" : ['-ldl', '-lpthread']
72
- }
73
- ],
74
- [
75
- 'OS=="aix"', {
76
- "variables" : {
77
- "dpi_check%" : "<!(INSTURL=\"https://oracle.github.io/node-oracledb/INSTALL.html#github\"; ERR=\"oracledb ERR! Error:\"; if [ -f odpi/include/dpi.h ]; then echo \"Has dpi.h\"; else echo \"$ERR Cannot find odpi/include/dpi.h. For GitHub ZIP downloads you must separately download the odpi subdirectory from GitHub.\" >&2; echo \"$ERR See $INSTURL\" >&2; echo \"\" >&2; fi;)"
78
- },
79
- "cflags" : ['-fexceptions', '-fsigned-char'],
80
- "cflags_cc" : ['-fexceptions', '-fsigned-char'],
81
- "libraries" : ['-ldl', '-lpthread'],
82
- }
83
- ],
84
- [
85
- 'OS=="solaris"', {
86
- "variables" : {
87
- "dpi_check%" : "<!(INSTURL=\"https://oracle.github.io/node-oracledb/INSTALL.html#github\"; ERR=\"oracledb ERR! Error:\"; if [ -f odpi/include/dpi.h ]; then echo \"Has dpi.h\"; else echo \"$ERR Cannot find odpi/include/dpi.h. For GitHub ZIP downloads you must separately download the odpi subdirectory from GitHub.\" >&2; echo \"$ERR See $INSTURL\" >&2; echo \"\" >&2; fi;)"
88
- },
89
- "cflags" : ['-fexceptions'],
90
- "cflags_cc" : ['-fexceptions'],
91
- "libraries" : ['-ldl', '-lpthread'],
92
- }
93
- ],
94
- [
95
- "OS=='win'", {
96
- "configurations" : {
97
- "Release" : {
98
- "msvs_settings": {
99
- "VCCLCompilerTool": {
100
- "RuntimeLibrary": 0,
101
- "Optimization": 3,
102
- "FavorSizeOrSpeed": 1,
103
- "InlineFunctionExpansion": 2,
104
- "WholeProgramOptimization": "true",
105
- "OmitFramePointers": "true",
106
- "EnableFunctionLevelLinking": "true",
107
- "EnableIntrinsicFunctions": "true",
108
- "RuntimeTypeInfo": "false",
109
- "PreprocessorDefinitions": [
110
- "WIN32_LEAN_AND_MEAN"
111
- ],
112
- "ExceptionHandling": "0",
113
- "AdditionalOptions": [
114
- "/EHsc"
115
- ]
116
- },
117
- "VCLibrarianTool": {
118
- "AdditionalOptions": [
119
- "/LTCG"
120
- ]
121
- },
122
- "VCLinkerTool": {
123
- "LinkTimeCodeGeneration": 1,
124
- "OptimizeReferences": 2,
125
- "EnableCOMDATFolding": 2,
126
- "LinkIncremental": 1,
127
- }
128
- }
129
- },
130
- "Debug": {
131
- "msvs_settings": {
132
- "VCCLCompilerTool": {
133
- "PreprocessorDefinitions": [
134
- "WIN32_LEAN_AND_MEAN"
135
- ],
136
- "ExceptionHandling": "0",
137
- "AdditionalOptions": [
138
- "/EHsc"
139
- ]
140
- },
141
- "VCLibrarianTool": {
142
- "AdditionalOptions": [
143
- "/LTCG"
144
- ]
145
- },
146
- "VCLinkerTool": {
147
- "LinkTimeCodeGeneration": 1,
148
- "LinkIncremental": 1,
149
- }
150
- }
151
- }
152
- }
153
- }
154
- ],
155
- ],
156
- "include_dirs" : [ "odpi/src/",
157
- "odpi/include/",
158
- "<!(node -e \"require('nan')\")"
159
- ],
160
- }
161
- ]
162
- }
package/lib/rel.txt DELETED
@@ -1 +0,0 @@
1
- 4eff9cf0209807e04115122bb40d4581750ed2d9 Mon 1 Oct 2018 08:35:04 UTC
package/odpi/.npmignore DELETED
@@ -1,4 +0,0 @@
1
- build
2
- lib
3
- doc/build
4
- test/build