Skip to content

Commit

Permalink
3.2.3
Browse files Browse the repository at this point in the history
 * 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)
  • Loading branch information
bimalkjha committed Nov 16, 2023
1 parent 424026b commit 0e14011
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 21 deletions.
2 changes: 1 addition & 1 deletion APIDocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1561,7 +1561,7 @@ try {
console.log("data = ", data);
} catch(err) {console.log(err);}
```
Check [test-asyc-await.js](https://github.com/ibmdb/node-ibm_db/blob/master/test/test-asyc-await.js) for example.
Check [test-asyc-await.js](https://github.com/ibmdb/node-ibm_db/blob/master/test/test-asyc-await.js#L50) for example.
### <a name="setMaxPoolSize"></a> 7) .setMaxPoolSize(N)
Expand Down
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2023-11-16, Version 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)


2023-09-23, Version 3.2.2
=========================

Expand Down
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Async APIs return promises if callback function is not used. Async APIs supports

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

- 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.
- 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.
Install a newer compiler or upgrade older one.

- 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.
Expand All @@ -34,7 +34,7 @@ Install a newer compiler or upgrade older one.

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

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

- 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.

Expand All @@ -43,6 +43,8 @@ Install a newer compiler or upgrade older one.
- 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.

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

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

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

## Install

Expand Down Expand Up @@ -79,7 +81,7 @@ export npm_config_loglevel=silent => For silent mode installation.
For **ELECTRON** or **VSCode** Installation:
```
npm install ibm_db -electron=<electron_version>
npm install ibm_db -electron="19.0.17"
npm install ibm_db -electron="25.9.2"
npm install ibm_db -vscode
```
To install using **specific version of clidriver** from https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/:
Expand Down Expand Up @@ -511,6 +513,15 @@ flag `DEBUG` to the defines section of the `binding.gyp` file and then execute
],
<snip>
```
OR,
```
cd ibm_db
npm install --debug
```
Above two method will enable debugging messages from C++ code. You can enable
debugging messages from nodejs code by calling [ibmdb.debug(true)](https://github.com/ibmdb/node-ibm_db/blob/master/APIDocumentation.md#-38-debugvalue)
api from your application.
### Unicode
Expand Down Expand Up @@ -566,7 +577,7 @@ define in `binding.gyp`
## Tips
### Using node < v0.10 on Linux
### Using more than 4 threads on Linux
Be aware that through node v0.9 the uv_queue_work function, which is used to
execute the ODBC functions on a separate thread, uses libeio for its thread
Expand Down
26 changes: 26 additions & 0 deletions examples/test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// To run this test.ts file, follow below steps
// npm install -g typescript
// update database connection info in ../test/config.json file
// tsc test.ts --lib es2015,dom
// node test.js

import * as ibmdb from '../'
import * as common from '../test/common.js'

let cn = common.connectionString
, pool = new ibmdb.Pool();

async function main(){
const query = `SELECT * FROM employee WHERE phoneno = ?;`

await pool.initAsync(1, cn)
const conn = await pool.open(cn)
const stmt = await conn.prepare(query)
const result = await stmt.execute([3978])

const fetched = await result.fetchAll()
console.log(fetched);
await conn.close()
}

main()
3 changes: 2 additions & 1 deletion installer/driverInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ var install_node_ibm_db = function(file_url) {
odbcBindingsNode = 'build\/Release\/odbc_bindings' + fileName + '.node';
if(electronVersion[0] < 19) {
console.log("No precompiled electron binary available"+
" for electron " + electronVersion + "\n");
" for electron " + electron_version + "\n");
process.exit(1);
}
}
Expand Down Expand Up @@ -675,6 +675,7 @@ var install_node_ibm_db = function(file_url) {
}
// We have correct bindings file in odbcBindingsNode for
// installed node version now. Extract it from build.zip file.
printMsg("Extracting " + odbcBindingsNode + " from build.zip");

// Removing the "build" directory created by Auto Installation Process.
// "adm-zip" will create a fresh "build" directory for extraction of "build.zip".
Expand Down
20 changes: 8 additions & 12 deletions lib/odbc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1338,27 +1338,23 @@ Database.prototype.describe = async function(obj, callback)
"anything productive to happen in the describe method."
};

if (typeof(callback) !== "function")
{
if (typeof(callback) !== "function") {
callback = null;
deferred = Q.defer();
}

if (typeof(obj) !== "object")
{
deferred ? deferred.reject(error) : callback(error, []);
throw new Error(error.message);
if(!callback) {
deferred = Q.defer();
}
if (typeof(obj) !== "object") {
deferred ? deferred.reject(error) : callback && callback(error, []);
}

if (!obj.database)
{
if (!obj.database) {
error = {
error : "[node-ibmdb] Missing Arguments",
message : "The object you passed did not contain a database " +
"property. This is required for the describe method to work."
};
deferred ? deferred.reject(error) : callback(error, []);
throw new Error(error.message);
deferred ? deferred.reject(error) : callback && callback(error, []);
}

//set some defaults if they weren't passed
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ibm_db",
"description": "IBM DB2 and IBM Informix bindings for node",
"version": "3.2.2",
"version": "3.2.3",
"main": "lib/odbc.js",
"homepage": "https://github.com/ibmdb/node-ibm_db/",
"repository": {
Expand Down

0 comments on commit 0e14011

Please sign in to comment.