oracledb 3.1.2 → 4.2.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 (53) hide show
  1. package/CHANGELOG.md +277 -4
  2. package/LICENSE.md +5906 -360
  3. package/README.md +7 -8
  4. package/build/Release/oracledb-4.2.0-darwin-x64.node +0 -0
  5. package/build/Release/oracledb-4.2.0-darwin-x64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-4.2.0-linux-x64.node +0 -0
  7. package/build/Release/oracledb-4.2.0-linux-x64.node-buildinfo.txt +1 -0
  8. package/build/Release/oracledb-4.2.0-win32-x64.node +0 -0
  9. package/build/Release/oracledb-4.2.0-win32-x64.node-buildinfo.txt +1 -0
  10. package/lib/aqDeqOptions.js +29 -0
  11. package/lib/aqEnqOptions.js +29 -0
  12. package/lib/aqMessage.js +29 -0
  13. package/lib/aqQueue.js +84 -0
  14. package/lib/connection.js +294 -326
  15. package/lib/dbObject.js +144 -0
  16. package/lib/lob.js +125 -132
  17. package/lib/oracledb.js +162 -483
  18. package/lib/pool.js +95 -109
  19. package/lib/{querystream.js → queryStream.js} +31 -30
  20. package/lib/resultset.js +75 -125
  21. package/lib/sodaCollection.js +99 -165
  22. package/lib/sodaDatabase.js +58 -133
  23. package/lib/sodaDocCursor.js +27 -70
  24. package/lib/sodaDocument.js +35 -65
  25. package/lib/sodaOperation.js +96 -252
  26. package/lib/util.js +78 -71
  27. package/package/README.md +41 -36
  28. package/package/install.js +30 -24
  29. package/package.json +2 -2
  30. package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
  31. package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +0 -1
  32. package/build/Release/oracledb-abi48-linux-x64.node +0 -0
  33. package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +0 -1
  34. package/build/Release/oracledb-abi48-win32-x64.node +0 -0
  35. package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +0 -1
  36. package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
  37. package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +0 -1
  38. package/build/Release/oracledb-abi57-linux-x64.node +0 -0
  39. package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +0 -1
  40. package/build/Release/oracledb-abi57-win32-x64.node +0 -0
  41. package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +0 -1
  42. package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
  43. package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +0 -1
  44. package/build/Release/oracledb-abi64-linux-x64.node +0 -0
  45. package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +0 -1
  46. package/build/Release/oracledb-abi64-win32-x64.node +0 -0
  47. package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +0 -1
  48. package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
  49. package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +0 -1
  50. package/build/Release/oracledb-abi67-linux-x64.node +0 -0
  51. package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +0 -1
  52. package/build/Release/oracledb-abi67-win32-x64.node +0 -0
  53. package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +0 -1
package/package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Overview
2
2
 
3
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.
4
+ package](https://www.npmjs.com/package/oracledb). The scripts can also be used
5
+ to create a custom package for hosting on a local server.
6
6
 
7
7
  Most users do not need to use anything in this directory.
8
8
 
@@ -10,37 +10,42 @@ Most users do not need to use anything in this directory.
10
10
 
11
11
  In a clone or copy of the repository:
12
12
 
13
- - `npm run buildbinary` calls `buildbinary.js` to create a binary for
14
- the current node-oracledb / Node.js / platform combination.
15
-
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.
21
-
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.
26
-
27
- Package installation:
28
-
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.
32
-
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.
37
-
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.
41
-
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.
13
+ - Run `npm run buildbinary`. This calls `buildbinary.js` to create a
14
+ node-oracledb binary for the current operating system. Depending how Node.js
15
+ was installed, you may need to run `npm install node-gyp -g` first.
16
+
17
+ You can run `npm run buildbinary` on each operating system architecture that
18
+ you want to include in your package. Copy the node-oracledb binaries and
19
+ related build metadata information files to the `package/Staging` directory on
20
+ one machine.
21
+
22
+ - Run `npm run buildpackage`. This calls `buildpackage.js` to make the
23
+ node-oracledb package containing the node-oracledb JavaScript files, the
24
+ available binaries, and a `package.json` that has `install` and `prune` script
25
+ targets. The package will be created in the top level directory. It can be
26
+ uploaded to npmjs.com, or to your own local server, and then used as a
27
+ dependency in your projects.
28
+
29
+ # Package Installation
30
+
31
+ - As part of an `npm install` that uses the created package, the `package.json`
32
+ install script runs `install.js` to check the availability of a binary module
33
+ for the current Node.js version and operating system architecture.
34
+
35
+ If a suitable binary is not available, installation will fail. Users must
36
+ then compile node-oracledb using source code from GitHub. Alternatively a
37
+ different version of node-oracledb, Node.js, or different operating system may
38
+ have a suitable pre-built binary available. See
39
+ https://github.com/oracle/node-oracledb/releases for information about Node.js
40
+ versions and pre-built node-oracledb binaries.
41
+
42
+ - After install, space conscious users can run `npm run prune` which removes
43
+ pre-built binaries for all other architectures.
44
+
45
+ The
46
+ [`package.json`](https://github.com/oracle/node-oracledb/blob/master/package.json)
47
+ in GitHub doesn't have an `install` script target by default. This means that
48
+ node-gyp will be invoked to compile node-oracledb. This allows installation
49
+ from GitHub [source
50
+ code](https://oracle.github.io/node-oracledb/INSTALL.html#github) when no
51
+ suitable pre-built binary is available.
@@ -36,14 +36,6 @@
36
36
  const fs = require('fs');
37
37
  const nodbUtil = require('../lib/util.js');
38
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
39
  // Log standard output with an 'oracledb' prefix
48
40
  function log(message) { // eslint-disable-line
49
41
  const args = Array.from(arguments);
@@ -64,7 +56,11 @@ function done(err) {
64
56
 
65
57
  if (err) { // Couldn't install the binary
66
58
  error(err.message);
67
- error('Try compiling node-oracledb source code using ' + installUrl + '#github');
59
+ if (err.message.match(/^NJS-067/)) {
60
+ error('Try compiling node-oracledb source code using ' + installUrl + '#github');
61
+ } else if (err.message.match(/^NJS-069/)) {
62
+ error('An older node-oracledb version may work with Node.js ' + process.version);
63
+ }
68
64
  process.exit(87);
69
65
  } else { // Successfully installed
70
66
  let arch;
@@ -78,32 +74,32 @@ function done(err) {
78
74
 
79
75
  log('********************************************************************************');
80
76
 
81
- log('** Node-oracledb ' + PACKAGE_JSON_VERSION + ' installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
77
+ log('** Node-oracledb ' + nodbUtil.PACKAGE_JSON_VERSION + ' installed for Node.js ' + process.versions.node + ' (' + process.platform + ', ' + process.arch +')');
82
78
 
83
79
  log('**');
84
80
  log('** To use node-oracledb:');
85
81
 
86
82
  if (process.platform === 'linux') {
87
83
  if (process.arch === 'x64') {
88
- clientUrl = 'https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html';
84
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html';
89
85
  } else {
90
- clientUrl = 'https://www.oracle.com/technetwork/topics/linuxsoft-082809.html';
86
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/linux-x86-32-downloads.html';
91
87
  }
92
88
 
93
89
  log('** - Oracle Client libraries (' + arch + ') must be configured with ldconfig or LD_LIBRARY_PATH');
94
90
  log('** - To get libraries, install an Instant Client Basic or Basic Light package from');
95
91
  log('** ' + clientUrl);
96
92
  } else if (process.platform === 'darwin') {
97
- clientUrl = 'https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html';
93
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/macos-intel-x86-downloads.html';
98
94
  installUrl = 'https://oracle.github.io/node-oracledb/INSTALL.html#instosx';
99
95
 
100
- log('** - An Oracle Instant Client Basic or Basic Light package must be in ~/lib or /usr/local/lib');
96
+ log('** - Oracle Instant Client Basic or Basic Light package libraries must be in ~/lib or /usr/local/lib');
101
97
  log('** Download from ' + clientUrl);
102
98
  } else if (process.platform === 'win32') {
103
99
  if (process.arch === 'x64') {
104
- clientUrl = 'https://www.oracle.com/technetwork/topics/winx64soft-089540.html';
100
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html';
105
101
  } else {
106
- clientUrl = 'https://www.oracle.com/technetwork/topics/winsoft-085727.html';
102
+ clientUrl = 'https://www.oracle.com/database/technologies/instant-client/microsoft-windows-32-downloads.html';
107
103
  }
108
104
 
109
105
  log('** - Oracle Client libraries (' + arch + ') must be in your PATH environment variable');
@@ -124,15 +120,25 @@ function done(err) {
124
120
  }
125
121
  }
126
122
 
127
- // Check there is a usable binary file for the node-oracledb module
123
+ // Check for a usable binary file for the node-oracledb module.
124
+ // Node.js 8.16 and 10.16 (and 12.0) contain an important N-API
125
+ // performance regression fix. If you're using the obsolete Node.js 9
126
+ // or 11 versions, install will work but you're on your own regarding
127
+ // performance and functionality.
128
+
128
129
  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)));
130
+ let vs = process.version.substring(1).split(".").map(Number);
131
+ if (vs[0] < 8 || (vs[0] === 8 && vs[1] < 16)) {
132
+ cb(new Error(nodbUtil.getErrorMessage('NJS-069', nodbUtil.PACKAGE_JSON_VERSION, "8.16")));
133
+ } else if (vs[0] === 10 && vs[1] < 16) {
134
+ cb(new Error(nodbUtil.getErrorMessage('NJS-069', nodbUtil.PACKAGE_JSON_VERSION, "10.16")));
135
+ } else {
136
+ try {
137
+ fs.statSync(nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE);
138
+ cb();
139
+ } catch (err) {
140
+ cb(new Error(nodbUtil.getErrorMessage('NJS-067', process.platform + ' ' + process.arch)));
141
+ }
136
142
  }
137
143
  }
138
144
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "3.1.2",
3
+ "version": "4.2.0",
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/",
@@ -33,7 +33,7 @@
33
33
  "prune": "node package/prunebinaries.js"
34
34
  },
35
35
  "engines": {
36
- "node": ">=6"
36
+ "node": ">=8.16"
37
37
  },
38
38
  "maintainers": [
39
39
  {
@@ -1 +0,0 @@
1
- oracledb-abi48-darwin-x64.node v6.16.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 22:43:26 GMT
@@ -1 +0,0 @@
1
- oracledb-abi48-linux-x64.node v6.16.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 23:04:20 GMT
@@ -1 +0,0 @@
1
- oracledb-abi48-win32-x64.node v6.16.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Wed, 20 Feb 2019 05:36:36 GMT
@@ -1 +0,0 @@
1
- oracledb-abi57-darwin-x64.node v8.15.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 22:44:49 GMT
@@ -1 +0,0 @@
1
- oracledb-abi57-linux-x64.node v8.15.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 23:04:59 GMT
@@ -1 +0,0 @@
1
- oracledb-abi57-win32-x64.node v8.15.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Wed, 20 Feb 2019 05:36:45 GMT
@@ -1 +0,0 @@
1
- oracledb-abi64-darwin-x64.node v10.15.1 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 22:45:35 GMT
@@ -1 +0,0 @@
1
- oracledb-abi64-linux-x64.node v10.15.1 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 23:06:02 GMT
@@ -1 +0,0 @@
1
- oracledb-abi64-win32-x64.node v10.15.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Wed, 20 Feb 2019 05:36:58 GMT
@@ -1 +0,0 @@
1
- oracledb-abi67-darwin-x64.node v11.10.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 22:46:26 GMT
@@ -1 +0,0 @@
1
- oracledb-abi67-linux-x64.node v11.10.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Tue, 19 Feb 2019 23:06:38 GMT
@@ -1 +0,0 @@
1
- oracledb-abi67-win32-x64.node v11.10.0 e70199aedd8542402cb2c5f8d75c2f8aa621df76 5768d8f93ef9ba42e8d4a6d701ace16504debc90 Wed, 20 Feb 2019 05:37:10 GMT