Skip to content

Commit

Permalink
add support for nodev23.x
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalkjha committed Nov 13, 2024
1 parent 52573c5 commit e39b324
Show file tree
Hide file tree
Showing 5 changed files with 370 additions and 58 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Async APIs return promises if callback function is not used. Async APIs supports

- UBI9 has deprecated libcrypt. You need to install libcrypt and libxcrypt-compat on UBI9 manually.

- **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 version >= 2017 is required.
- **For Windows**: compiler is optional as `ibm_db` comes with pre-compiled binary on Windows64 for node.js version >= 14.x. To compile code on Windows, VC++ 2015.3 v14.00 (v140) or Visual Studio version >= 2017 is required.

- Python version >= 3.8.0 is required by node-gyp. For **z/OS**, Python 2.7.13 or higher, but lower than Python 3.0, is required.

Expand All @@ -58,11 +58,11 @@ node-gyp 3.4.0<br>
npm 3.10.10<br>
ibm_db: 2.8.1

- Recommended version of node.js is >= V12.X. For node.js version < 12.X and `ibm_db` version > 2.4.1, Visual Studio is required to install `ibm_db` on Windows.
- Recommended version of node.js is >= V16.X. For node.js version < 14.X and `ibm_db` version > 2.4.1, Visual Studio is required to install `ibm_db` on Windows.

- 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: **22.9.0**
- The latest node.js version using which `ibm_db` is tested: **23.2.0**

## Install

Expand Down
Binary file modified build.zip
Binary file not shown.
39 changes: 15 additions & 24 deletions installer/driverInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var platform = os.platform();
var arch = os.arch();

var vscode_build = false;
var electron_version = '30.1.2';
var electron_version = '32.2.1';
var downloadProgress = 0;
var silentInstallation = false;

Expand Down Expand Up @@ -60,7 +60,7 @@ if (process.env.npm_config_cafile) {
/* Read specific version of clidriver specified with install command
* npm install ibm_db -clidriver=v11.1.4
*/
var clidriverVersion;
var clidriverVersion="v11.5.9";
if(process.env.npm_config_clidriver && process.env.npm_config_clidriver != true) {
clidriverVersion = process.env.npm_config_clidriver;
}
Expand Down Expand Up @@ -634,25 +634,22 @@ var install_node_ibm_db = function(file_url) {
else
{
//Windows node binary names should update here.
var ODBC_BINDINGS_V10 = 'build\/Release\/odbc_bindings.node.10.24.1';
var ODBC_BINDINGS_V11 = 'build\/Release\/odbc_bindings.node.11.15.0';
var ODBC_BINDINGS_V12 = 'build\/Release\/odbc_bindings.node.12.22.12';
var ODBC_BINDINGS_V13 = 'build\/Release\/odbc_bindings.node.13.14.0';
var ODBC_BINDINGS_V14 = 'build\/Release\/odbc_bindings.node.14.21.3';
var ODBC_BINDINGS_V15 = 'build\/Release\/odbc_bindings.node.15.14.0';
var ODBC_BINDINGS_V16 = 'build\/Release\/odbc_bindings.node.16.20.2';
var ODBC_BINDINGS_V17 = 'build\/Release\/odbc_bindings.node.17.9.1';
var ODBC_BINDINGS_V18 = 'build\/Release\/odbc_bindings.node.18.20.2';
var ODBC_BINDINGS_V18 = 'build\/Release\/odbc_bindings.node.18.20.5';
var ODBC_BINDINGS_V19 = 'build\/Release\/odbc_bindings.node.19.9.0';
var ODBC_BINDINGS_V20 = 'build\/Release\/odbc_bindings.node.20.18.0';
var ODBC_BINDINGS_V21 = 'build\/Release\/odbc_bindings.node.21.7.3';
var ODBC_BINDINGS_V22 = 'build\/Release\/odbc_bindings.node.22.11.0';

// Windows add-on binary for node.js v0.10.x, v0.12.7, 4.x, 6.x, 7.x, 8.x and 9.x has been discontinued.
if(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 10.0) {
// Windows add-on binary for node.js v0.10.x, v0.12.7, 4.x, 6.x to 14.x has been discontinued.
if(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 14.0) {
console.log('\nERROR: Did not find precompiled add-on binary for node.js version ' + process.version + ':' +
'\nibm_db does not provide precompiled add-on binary for node.js version ' + process.version +
' on Windows platform. Visual Studio is required to compile ibm_db with node.js versions < 10.X. ' +
'Otherwise please use the node.js version >= 10.X\n');
' on Windows platform. Visual Studio is required to compile ibm_db with node.js versions < 14.X. ' +
'Otherwise please use the node.js version >= 14.X\n');
process.exit(1);
}

Expand All @@ -661,18 +658,15 @@ var install_node_ibm_db = function(file_url) {
* file name according to the node version in the system.
*/
odbcBindingsNode =
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 11.0) && ODBC_BINDINGS_V10 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 12.0) && ODBC_BINDINGS_V11 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 13.0) && ODBC_BINDINGS_V12 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 14.0) && ODBC_BINDINGS_V13 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 15.0) && ODBC_BINDINGS_V14 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 16.0) && ODBC_BINDINGS_V15 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 17.0) && ODBC_BINDINGS_V16 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 18.0) && ODBC_BINDINGS_V17 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 19.0) && ODBC_BINDINGS_V18 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 20.0) && ODBC_BINDINGS_V19 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 21.0) && ODBC_BINDINGS_V20 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 21.0) && ODBC_BINDINGS_V21 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 22.0) && ODBC_BINDINGS_V21 ||
(Number(process.version.match(/^v(\d+\.\d+)/)[1]) < 23.0) && ODBC_BINDINGS_V22 ||
ODBC_BINDINGS;
}
// We have correct bindings file in odbcBindingsNode for
Expand Down Expand Up @@ -869,7 +863,10 @@ function findElectronVersion() {
var codeOut = execSync('code --version').toString();
vscodeVer = parseFloat(codeOut.split('\n')[0]);
if(!isNaN(vscodeVer)) {
if (vscodeVer >= 1.92){
if (vscodeVer >= 1.95){
electron_version = "32.2.1";
}
else if (vscodeVer >= 1.92){
electron_version = "30.1.2";
}
else if (vscodeVer >= 1.90){
Expand All @@ -887,14 +884,8 @@ function findElectronVersion() {
else if (vscodeVer >= 1.83){
electron_version = "25.8.4";
}
else if (vscodeVer >= 1.82){
else {// vscode version older than 1.82 not supported
electron_version = "25.8.0";
}
else if (vscodeVer >= 1.81){
electron_version = "22.3.18";
}
else {// vscode version older than 1.80 not supported
electron_version = "22.3.14";
printMsg("VSCode version " + vscodeVer + " is too old!");
}
printMsg("Detected VSCode version" + vscodeVer +
Expand Down
Loading

0 comments on commit e39b324

Please sign in to comment.