Skip to content

Commit 0e14011

Browse files
committed
3.2.3
* update precompiled binaries (Bimal Jha) * fea: add support for pool.initAsync() API, PR #953, issue #952 (Bimal Jha) * fix: compilation issue on z/OS, define SQL_BOOLEAN, issue #961 (Bimal Jha) * build(deps): bump axios from 1.5.0 to 1.6.0 (#964) (dependabot[bot]) * fix promise bug of executeNonQuery api, issue #960 (Bimal Jha) * read Db2 credential from Env var for testing (Bimal Jha)
1 parent 424026b commit 0e14011

File tree

8 files changed

+71
-21
lines changed

8 files changed

+71
-21
lines changed

APIDocumentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1561,7 +1561,7 @@ try {
15611561
console.log("data = ", data);
15621562
} catch(err) {console.log(err);}
15631563
```
1564-
Check [test-asyc-await.js](https://github.com/ibmdb/node-ibm_db/blob/master/test/test-asyc-await.js) for example.
1564+
Check [test-asyc-await.js](https://github.com/ibmdb/node-ibm_db/blob/master/test/test-asyc-await.js#L50) for example.
15651565
15661566
### <a name="setMaxPoolSize"></a> 7) .setMaxPoolSize(N)
15671567

CHANGES.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
2023-11-16, Version 3.2.3
2+
=========================
3+
4+
* update precompiled binaries (Bimal Jha)
5+
6+
* fea: add support for pool.initAsync() API, PR #953, issue #952 (Bimal Jha)
7+
8+
* fix: compilation issue on z/OS, define SQL_BOOLEAN, issue #961 (Bimal Jha)
9+
10+
* build(deps): bump axios from 1.5.0 to 1.6.0 (#964) (dependabot[bot])
11+
12+
* fix promise bug of executeNonQuery api, issue #960 (Bimal Jha)
13+
14+
* read Db2 credential from Env var for testing (Bimal Jha)
15+
16+
117
2023-09-23, Version 3.2.2
218
=========================
319

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Async APIs return promises if callback function is not used. Async APIs supports
2323

2424
- Make sure your system has C++ compiler installed that support C++11 standard.
2525

26-
- For non-windows platforms: gcc compiler version >= 8.4 is required to install `ibm_db`. Default compiler on RHEL 6 does not have the required support.
26+
- For non-windows platforms: gcc compiler version >= 8.4 and `make` is required to install `ibm_db`. Default compiler on RHEL 6 does not have the required support.
2727
Install a newer compiler or upgrade older one.
2828

2929
- For Windows: compiler is optional as `ibm_db` comes with pre-compiled binary on Windows64 for node.js version >= 12.x. To compile code on Windows, VC++ 2015.3 v14.00 (v140) or Visual Studio 2017 is required.
@@ -34,7 +34,7 @@ Install a newer compiler or upgrade older one.
3434

3535
- **For Windows Subsystem for Linux (WSL):** Install `build-essentials` package before installing `ibm_db`.
3636

37-
- **For MacOS:** Install XCode from appstore before installing `ibm_db`. Also, gcc@8 is required.
37+
- **For MacOS:** Install XCode from appstore before installing `ibm_db`. Also, gcc@8 and `make` is required.
3838

3939
- On distributed platforms, you do need not to install any Db2 ODBC client driver for connectivity. `ibm_db` itself downloads and installs an odbc/cli driver from IBM website during installation. Just install `ibm_db` and it is ready for use.
4040

@@ -43,6 +43,8 @@ Install a newer compiler or upgrade older one.
4343
- On z/OS and other non-Windows platform, `GNU make` is required to install `ibm_db`. Execute `make -v` command before installing `ibm_db` to make sure you have correct `make` set in PATH.
4444

4545
- On z/OS only certain versions of node-gyp are supported. This was tested with:<br>
46+
z/OS v2.4
47+
Db2 v12.0
4648
node-gyp 3.4.0<br>
4749
npm 3.10.10<br>
4850
ibm_db: 2.8.1
@@ -51,7 +53,7 @@ ibm_db: 2.8.1
5153

5254
- For Node.js >= V15.x on RHEL and RHEL 8.x, GCC v8.2.1 is required.
5355

54-
- The latest node.js version using which `ibm_db` is tested: **20.7.0**
56+
- The latest node.js version using which `ibm_db` is tested: **21.2.0**
5557

5658
## Install
5759

@@ -79,7 +81,7 @@ export npm_config_loglevel=silent => For silent mode installation.
7981
For **ELECTRON** or **VSCode** Installation:
8082
```
8183
npm install ibm_db -electron=<electron_version>
82-
npm install ibm_db -electron="19.0.17"
84+
npm install ibm_db -electron="25.9.2"
8385
npm install ibm_db -vscode
8486
```
8587
To install using **specific version of clidriver** from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/:
@@ -511,6 +513,15 @@ flag `DEBUG` to the defines section of the `binding.gyp` file and then execute
511513
],
512514
<snip>
513515
```
516+
OR,
517+
```
518+
cd ibm_db
519+
npm install --debug
520+
```
521+
522+
Above two method will enable debugging messages from C++ code. You can enable
523+
debugging messages from nodejs code by calling [ibmdb.debug(true)](https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#-38-debugvalue)
524+
api from your application.
514525
515526
### Unicode
516527
@@ -566,7 +577,7 @@ define in `binding.gyp`
566577
567578
## Tips
568579
569-
### Using node < v0.10 on Linux
580+
### Using more than 4 threads on Linux
570581
571582
Be aware that through node v0.9 the uv_queue_work function, which is used to
572583
execute the ODBC functions on a separate thread, uses libeio for its thread

examples/test.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// To run this test.ts file, follow below steps
2+
// npm install -g typescript
3+
// update database connection info in ../test/config.json file
4+
// tsc test.ts --lib es2015,dom
5+
// node test.js
6+
7+
import * as ibmdb from '../'
8+
import * as common from '../test/common.js'
9+
10+
let cn = common.connectionString
11+
, pool = new ibmdb.Pool();
12+
13+
async function main(){
14+
const query = `SELECT * FROM employee WHERE phoneno = ?;`
15+
16+
await pool.initAsync(1, cn)
17+
const conn = await pool.open(cn)
18+
const stmt = await conn.prepare(query)
19+
const result = await stmt.execute([3978])
20+
21+
const fetched = await result.fetchAll()
22+
console.log(fetched);
23+
await conn.close()
24+
}
25+
26+
main()

installer/driverInstall.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ var install_node_ibm_db = function(file_url) {
627627
odbcBindingsNode = 'build\/Release\/odbc_bindings' + fileName + '.node';
628628
if(electronVersion[0] < 19) {
629629
console.log("No precompiled electron binary available"+
630-
" for electron " + electronVersion + "\n");
630+
" for electron " + electron_version + "\n");
631631
process.exit(1);
632632
}
633633
}
@@ -675,6 +675,7 @@ var install_node_ibm_db = function(file_url) {
675675
}
676676
// We have correct bindings file in odbcBindingsNode for
677677
// installed node version now. Extract it from build.zip file.
678+
printMsg("Extracting " + odbcBindingsNode + " from build.zip");
678679

679680
// Removing the "build" directory created by Auto Installation Process.
680681
// "adm-zip" will create a fresh "build" directory for extraction of "build.zip".

lib/odbc.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,27 +1338,23 @@ Database.prototype.describe = async function(obj, callback)
13381338
"anything productive to happen in the describe method."
13391339
};
13401340

1341-
if (typeof(callback) !== "function")
1342-
{
1341+
if (typeof(callback) !== "function") {
13431342
callback = null;
1344-
deferred = Q.defer();
13451343
}
1346-
1347-
if (typeof(obj) !== "object")
1348-
{
1349-
deferred ? deferred.reject(error) : callback(error, []);
1350-
throw new Error(error.message);
1344+
if(!callback) {
1345+
deferred = Q.defer();
1346+
}
1347+
if (typeof(obj) !== "object") {
1348+
deferred ? deferred.reject(error) : callback && callback(error, []);
13511349
}
13521350

1353-
if (!obj.database)
1354-
{
1351+
if (!obj.database) {
13551352
error = {
13561353
error : "[node-ibmdb] Missing Arguments",
13571354
message : "The object you passed did not contain a database " +
13581355
"property. This is required for the describe method to work."
13591356
};
1360-
deferred ? deferred.reject(error) : callback(error, []);
1361-
throw new Error(error.message);
1357+
deferred ? deferred.reject(error) : callback && callback(error, []);
13621358
}
13631359

13641360
//set some defaults if they weren't passed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ibm_db",
33
"description": "IBM DB2 and IBM Informix bindings for node",
4-
"version": "3.2.2",
4+
"version": "3.2.3",
55
"main": "lib/odbc.js",
66
"homepage": "https://github.com/ibmdb/node-ibm_db/",
77
"repository": {

0 commit comments

Comments
 (0)