Skip to content

Commit 13ef091

Browse files
authored
Merge pull request #16 from romanbalayan/release-6.2.0
6.2.0
2 parents 94d28ce + aa156d8 commit 13ef091

25 files changed

+700
-517
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
# node-oracledb-prebuilt-for-lambda
22

33
- This module is forked from the currently un-maintained [node-oracledb-for-lambda](https://github.com/nalbion/node-oracledb-for-lambda).
4-
- Core oracledb libraries are derived from [node-oracledb](https://github.com/oracle/node-oracledb) v6.1.0
5-
- 6.1.0: Prebuilt for use with AWS Lambda nodejs18.x Runtime
4+
- Core oracledb libraries are derived from [node-oracledb](https://github.com/oracle/node-oracledb) v6.2.0
5+
- 6.2.0: Prebuilt for use with AWS Lambda nodejs18.x Runtime
66
- Also tested to work with AWS Lambda nodejs14.x, nodejs16.x, and nodejs18.x Runtime
77

88
The scripts to reproduce the build process can be found at [node-oracledb-lambda-test](https://github.com/romanbalayan/node-oracledb-lambda-test).
99

1010
# Usage
1111

1212
```bash
13-
npm install --save oracledb-prebuilt-for-lambda@6.1.0
13+
npm install --save oracledb-prebuilt-for-lambda@6.2.0
1414
```
1515

1616
# Versioning
1717
- Changed release version to match that of underlying node-oracledb version.
18-
- i.e. for release based on oracledb 6.1.0, release will be oracledb-prebuilt-for-lambda@6.1.0
18+
- i.e. for release based on oracledb 6.2.0, release will be oracledb-prebuilt-for-lambda@6.2.0
1919

2020

2121
# Releases
2222
| node-oracledb | oracledb-prebuilt-for-lambda |
2323
| ------------------- | ---------- |
24+
| 6.2.0 | 6.2.0 |
2425
| 6.1.0 | 6.1.0 |
2526
| 6.0.3 | 6.0.3 |
2627
| 6.0.1 | 6.0.1 |
@@ -36,6 +37,7 @@ npm install --save oracledb-prebuilt-for-lambda@6.1.0
3637

3738

3839
# Changelog
40+
- v6.2.0: [node-oracledb v6.2.0 changelog](https://node-oracledb.readthedocs.io/en/latest/release_notes.html#node-oracledb-v6-2-0-11-oct-2023)
3941
- v6.1.0: [node-oracledb v6.1.0 changelog](https://node-oracledb.readthedocs.io/en/latest/release_notes.html#node-oracledb-v6-1-0-30-aug-2023)
4042
- v6.0.3: [node-oracledb v6.0.3 changelog](https://node-oracledb.readthedocs.io/en/latest/release_notes.html#node-oracledb-v6-0-3-12-jul-2023)
4143
- v6.0.1: [node-oracledb v6.0.1 changelog](https://node-oracledb.readthedocs.io/en/latest/release_notes.html#node-oracledb-v6-0-1-07-jun-2023)

build/Release/oracledb.node

-15.8 KB
Binary file not shown.

lib/connection.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ class Connection extends EventEmitter {
10741074
//
10751075
// Returns the health status of the connection. If this function returns
10761076
// false, the caller should close the connection.
1077-
// ---------------------------------------------------------------------------
1077+
//---------------------------------------------------------------------------
10781078
isHealthy() {
10791079
return (this._impl !== undefined && !this._closing &&
10801080
this._impl.isHealthy());

lib/dbObject.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,15 @@ class BaseDbObject {
319319
return this._objType.schema;
320320
}
321321

322+
//---------------------------------------------------------------------------
323+
// packageName
324+
//
325+
// Property for the packageName of the database object type.
326+
//---------------------------------------------------------------------------
327+
get packageName() {
328+
return this._objType.packageName;
329+
}
330+
322331
//---------------------------------------------------------------------------
323332
// setElement()
324333
//

lib/errors.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ function assertArgCount(args, minArgCount, maxArgCount) {
466466
//-----------------------------------------------------------------------------
467467
// assertParamPropBool()
468468
//
469-
// Asserts that the property value of a parmeter is a boolean value (or
469+
// Asserts that the property value of a parameter is a boolean value (or
470470
// undefined).
471471
//-----------------------------------------------------------------------------
472472
function assertParamPropBool(obj, parameterNum, propName) {
@@ -479,7 +479,7 @@ function assertParamPropBool(obj, parameterNum, propName) {
479479
//-----------------------------------------------------------------------------
480480
// assertParamPropFunction()
481481
//
482-
// Asserts that the property value of a parmeter is a function (or undefined).
482+
// Asserts that the property value of a parameter is a function (or undefined).
483483
//-----------------------------------------------------------------------------
484484
function assertParamPropFunction(obj, parameterNum, propName) {
485485
if (obj[propName] !== undefined) {
@@ -491,7 +491,7 @@ function assertParamPropFunction(obj, parameterNum, propName) {
491491
//-----------------------------------------------------------------------------
492492
// assertParamPropInt()
493493
//
494-
// Asserts that the property value of a parmeter is an integer value (or
494+
// Asserts that the property value of a parameter is an integer value (or
495495
// undefined).
496496
//-----------------------------------------------------------------------------
497497
function assertParamPropInt(obj, parameterNum, propName) {
@@ -504,7 +504,7 @@ function assertParamPropInt(obj, parameterNum, propName) {
504504
//-----------------------------------------------------------------------------
505505
// assertParamPropUnsignedInt()
506506
//
507-
// Asserts that the property value of a parmeter is a positive integer value
507+
// Asserts that the property value of a parameter is a positive integer value
508508
// (or undefined).
509509
//-----------------------------------------------------------------------------
510510
function assertParamPropUnsignedInt(obj, parameterNum, propName) {
@@ -517,7 +517,7 @@ function assertParamPropUnsignedInt(obj, parameterNum, propName) {
517517
//-----------------------------------------------------------------------------
518518
// assertParamPropString()
519519
//
520-
// Asserts that the property value of a parmeter is a function (or undefined).
520+
// Asserts that the property value of a parameter is a string value (or undefined).
521521
//-----------------------------------------------------------------------------
522522
function assertParamPropString(obj, parameterNum, propName) {
523523
if (obj[propName] !== undefined) {
@@ -529,7 +529,7 @@ function assertParamPropString(obj, parameterNum, propName) {
529529
//-----------------------------------------------------------------------------
530530
// assertParamPropValue()
531531
//
532-
// Asserts that the property value of a parmeter passes the specified
532+
// Asserts that the property value of a parameter passes the specified
533533
// condition.
534534
//-----------------------------------------------------------------------------
535535
function assertParamPropValue(condition, parameterNum, propName) {
@@ -540,7 +540,7 @@ function assertParamPropValue(condition, parameterNum, propName) {
540540
//-----------------------------------------------------------------------------
541541
// assertParamValue()
542542
//
543-
// Asserts that the parmeter value passes the specified condition.
543+
// Asserts that the parameter value passes the specified condition.
544544
//-----------------------------------------------------------------------------
545545
function assertParamValue(condition, parameterNum) {
546546
assert(condition, ERR_INVALID_PARAMETER_VALUE, parameterNum);

lib/oracledb.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,26 @@ const defaultPoolAlias = 'default';
6969
let _initOracleClientArgs;
7070

7171
// Load the Oracledb binary
72-
function _initCLib() {
72+
function _initCLib(options) {
7373
/*global __non_webpack_require__*/ // quieten eslint
7474
const requireBinary = (typeof __non_webpack_require__ === 'function') ? __non_webpack_require__ : require; // See Issue 1156
75-
7675
const binaryLocations = [
7776
'../' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE, // pre-built binary
78-
'../' + nodbUtil.RELEASE_DIR + '/' + 'oracledb.node', // binary built from source
79-
'../build/Debug/oracledb.node', // debug binary
77+
'../' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BUILD_FILE, // binary built from source
78+
'../build/Debug/' + nodbUtil.BUILD_FILE, // debug binary
8079
// Paths for Webpack.
8180
// Note: to use node-oracledb Thick mode, you will need a Webpack copy plugin to
8281
// copy 'node_modules/oracledb/build/' to the output directory,
8382
// see https://github.com/oracle/node-oracledb/issues/1156
8483
// If you want to use only node-oracledb Thin mode, a copy plugin is not needed.
8584
'./node_modules/oracledb/' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BINARY_FILE,
86-
'./node_modules/oracledb/' + nodbUtil.RELEASE_DIR + '/' + 'oracledb.node'
85+
'./node_modules/oracledb/' + nodbUtil.RELEASE_DIR + '/' + nodbUtil.BUILD_FILE
8786
];
87+
88+
if (options.binaryDir !== undefined) {
89+
binaryLocations.splice(0, 0, options.binaryDir + '/' + nodbUtil.BINARY_FILE,
90+
options.binaryDir + '/' + nodbUtil.BUILD_FILE);
91+
}
8892
let oracledbCLib;
8993
for (let i = 0; i < binaryLocations.length; i++) {
9094
try {
@@ -682,12 +686,13 @@ function initOracleClient(arg1) {
682686
errors.assertParamPropString(options, 1, "configDir");
683687
errors.assertParamPropString(options, 1, "errorUrl");
684688
errors.assertParamPropString(options, 1, "driverName");
689+
errors.assertParamPropString(options, 1, "binaryDir");
685690
}
686691
if (settings.thinDriverInitialized) {
687692
errors.throwErr(errors.ERR_THIN_CONNECTION_ALREADY_CREATED);
688693
}
689694
if (_initOracleClientArgs === undefined) {
690-
const oracledbCLib = _initCLib();
695+
const oracledbCLib = _initCLib(options);
691696
if (options.driverName === undefined)
692697
options.driverName = constants.DEFAULT_DRIVER_NAME + " thk";
693698
if (options.errorUrl === undefined)

lib/sodaCollection.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,16 @@ class SodaCollection {
188188
return doc;
189189
}
190190

191+
//---------------------------------------------------------------------------
192+
// listIndexes()
193+
//
194+
// To obtain all indices from the collection
195+
//---------------------------------------------------------------------------
196+
async listIndexes() {
197+
const arr = await this._impl.listIndexes();
198+
return arr.map(i => JSON.parse(i));
199+
}
200+
191201
//---------------------------------------------------------------------------
192202
// metaData()
193203
//
@@ -262,6 +272,7 @@ nodbUtil.wrapFns(SodaCollection.prototype,
262272
"insertManyAndGet",
263273
"insertOne",
264274
"insertOneAndGet",
275+
"listIndexes",
265276
"save",
266277
"saveAndGet",
267278
"truncate");

lib/sodaOperation.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ class SodaOperation {
9494
}
9595
}
9696

97+
98+
//---------------------------------------------------------------------------
99+
// lock()
100+
//
101+
// Pessimistic locking - similar to SELECT FOR UPDATE, these documents
102+
// cannot be updated by other threads until an explicit commit/rollback is
103+
// called. With autoCommit set to true is applicable only for one immediate
104+
// operation and is not recommended in this context
105+
//---------------------------------------------------------------------------
106+
lock() {
107+
errors.assertArgCount(arguments, 0, 0);
108+
this._options.lock = true;
109+
return this;
110+
}
111+
112+
97113
//---------------------------------------------------------------------------
98114
// replaceOne()
99115
//

0 commit comments

Comments
 (0)