You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ibm_db

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm_db - npm Package Compare versions

Comparing version

to
3.3.0

8

CHANGES.md

@@ -0,1 +1,9 @@

2024-12-01, Version 3.3.0
=========================
* add electron binaries for macos arm64 system (Bimal Jha)
* fea: add support for native installation on MacOS M1 Chip system (Bimal Jha)
2024-11-21, Version 3.2.5

@@ -2,0 +10,0 @@ =========================

79

INSTALL.md

@@ -411,80 +411,7 @@ # Installing node-ibm_db

>
> **Important: We do not have clidriver/dsdriver for ARM64 architecture yet. The driver for IBM DB2 is not compatible with Apple Silicon and will have to run x86_64 version of clidriver in emulated mode.**
> Please support [this request for an Apple Silicon version of the driver](https://ibm-data-and-ai.ideas.ibm.com/ideas/DB2CON-I-92) to show IBM that you are interested in a native solution.
>
> ibm_db@3.3.0 onwards supports native installation on MacOS ARM64(M* Chip/Apple Silicon Chip) system using clidriver/dsdriver version 12.1.0.
**Warning:** If you use the ARM version of homebrew (as recommended for M1/M2 chip systems) you will get the following error message:
```
$ brew install gcc-12
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the
"Alternative Installs" from:
https://docs.brew.sh/Installation
You can migrate your previously installed formula list with:
brew bundle dump
```
Install `gcc@12` using homebrew `(note: the x86_64 version of homebrew is needed for this, not the recommended ARM based homebrew)`. The clearest instructions on how to install and use the `x86_64` version of `homebrew` is by following below steps:
* My arm64/M1 brew is installed here:
```
$ which brew
/opt/homebrew/bin/brew
```
* Step 1. Install x86_64 brew under /usr/local/bin/brew
`arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`
* Step 2. Create an alias for the x86_64 brew
I added this to my ~/.bashrc as below:
```
# brew hack for x86_64
alias brew64='arch -x86_64 /usr/local/bin/brew'
```
* Then install gcc@12 using the x86_64 homebrew:
```
brew64 install gcc@12
```
* Now find location of `lib/gcc/12/libstdc++.6.dylib` file in your system. It should be inside `/usr/local/homebrew/lib/gcc/12` or `/usr/local/lib/gcc/12` or `/usr/local/homebrew/Cellar/gcc@12/12.2.0/lib/gcc/12` or something similar. You need to find the correct path.
Suppose path of gcc lib is `/usr/local/homebrew/lib/gcc/12`. Then update your .bashrc/.zshrc file with below line
```
export DYLD_LIBRARY_PATH=/usr/local/homebrew/lib/gcc/12:$DYLD_LIBRARY_PATH
```
### Installation:
Follow same steps as documented for [Node-ibm_db Installation on MacOS](#insmac)
## Steps to Install Intel Python after verifying setup
* Open new terminal and run command `arch -x86_64 /bin/bash or arch -x86_64 /bin/zsh`.
* Verify the output of `gcc -v` command. It should show `Target: x86_64-apple-darwin21` in output.
* Install Intel Version of Python like: https://www.python.org/ftp/python/3.9.11/python-3.9.11-macosx10.9.pkg
* Check output of commands `python --version` , `which python` and `file /usr/local/bin/python` commands. It should show `/usr/local/bin/python: Mach-O 64-bit executable x86_64`
## Steps to Install x64 version of Node.js
* Open new terminal and run command `arch -x86_64 /bin/bash or arch -x86_64 /bin/zsh`.
* Verify the output of `gcc -v` command. It should show `Target: x86_64-apple-darwin21` in output.
* Install x64 Version of NodeJS like: https://nodejs.org/dist/v18.16.0/node-v18.16.0-darwin-x64.tar.gz
* Check output of commands `node -v` , `which node` and `file node` commands. It should show `node: Mach-O 64-bit executable x86_64`
## Install ibm_db with x86_64 version of gcc12 and node.js on M1/M2 Chip System
* Open a new terminal and run below commands:
```
gcc -v => Output should have x86_64
python --version or python3 --version
file `which python` or file `which python3` => Output should have x86_64
node -v
file `which node` => Output should have x86_64
npm uninstall ibm_db
npm install ibm_db
cd node_modules/ibm_db/installer
source ./setenv.sh
run your test program to verify.
```
### Getting error and unable to run test file
* If connection fails with SQL30081N error: means `ibm_db` installation is correct and you need to provide correct connection string.
* If `import ibm_db` fails with `Symbol not found: ___cxa_throw_bad_array_new_length` error or `malloc` error:
You need to find the correct location of lib/gcc/12 directory and add it to DYLD_LIBRARY_PATH environment variable.
Also, execute below commands from terminal with correct location of `lib/gcc/12/libstdc++.6.dylib` library.
```
cd node_modules/ibm_db/installer/clidriverd/lib
install_name_tool -change /usr/local/lib/gcc/8/libstdc++.6.dylib <full path of libstdc++.6.dylib> libdb2.dylib
f.e.
install_name_tool -change /usr/local/lib/gcc/8/libstdc++.6.dylib /usr/local/homebrew/lib/gcc/12/libstdc++.6.dylib libdb2.dylib
```
Now run your test program and verify.

@@ -43,11 +43,6 @@ /**

}
if(platform == 'darwin' && arch == 'arm64') {
console.log('Apple Silicon Chip system with arm64 architecture is not supported. ' +
'Please install x64 version of node.js and gcc to install ibm_db.\n' +
'Check https://github.com/ibmdb/node-ibm_db/blob/master/INSTALL.md#m1chip for instructions.\n');
if(platform != 'darwin' && arch == 'arm64') {
console.log('ARM64 processor is not supported on ' + platform + ' platform.\n' +
'Only MacOS with arm64 processor is supported.\n');
process.exit(1);
} else if(arch == 'arm64') {
console.log('ARM64 architecture is not supported. ' +
'Please install x64 version of node.js and gcc to install ibm_db.\n');
process.exit(1);
}

@@ -62,5 +57,5 @@

/* Read specific version of clidriver specified with install command
* npm install ibm_db -clidriver=v11.1.4
* npm install ibm_db -clidriver=v11.5.9
*/
var clidriverVersion="v11.5.9";
var clidriverVersion="v12.1.0";
if(process.env.npm_config_clidriver && process.env.npm_config_clidriver != true) {

@@ -70,2 +65,13 @@ clidriverVersion = process.env.npm_config_clidriver;

if(platform == 'darwin') {
if(arch == 'arm64' && clidriverVersion.startsWith("v11")) {
// v11 do not have arm64 clidriver, use default one.
clidriverVersion="";
}
else if(arch == 'x64' && clidriverVersion.startsWith("v12")) {
// v12 do not have x64 clidriver, use default one.
clidriverVersion="";
}
}
/* Show make version on non-windows platform, if installed. */

@@ -244,4 +250,3 @@ printMakeVersion();

if((platform == 'linux') || (platform =='aix') ||
(platform == 'darwin' && (arch == 'x64' || arch == 'arm64'))) {
if((platform == 'linux') || (platform =='aix') || (platform == 'darwin')) {
removeWinBuildArchive();

@@ -292,8 +297,6 @@ buildBinary(!IS_ENVIRONMENT_VAR);

} else if(arch == 'arm64') {
console.log('M1 Chip system with arm64 architecture is not supported. ' +
'Please install x64 version of node.js to install ibm_db.\n');
process.exit(1);
odbc_driver = 'macarm64_odbc_cli.tar.gz';
} else {
console.log('Mac OS 32 bit not supported. Please use an ' +
'x64 architecture.\n');
console.log('Mac OS 32 bit not supported. Please use ' +
'64 bit MacOS system.\n');
process.exit(1);

@@ -616,3 +619,3 @@ }

if(platform == 'win32' || vscode_build) {
if(arch == 'x64') {
if(arch.indexOf("64") > 0) {
var BUILD_FILE = path.resolve(CURRENT_DIR, 'build.zip');

@@ -627,3 +630,7 @@ var odbcBindingsNode;

if (platform == 'darwin') {
fileName = "_mac_" + electronVersion[0];
if (arch == 'arm64') {
fileName = "_macarm_" + electronVersion[0];
} else {
fileName = "_mac_" + electronVersion[0];
}
} else if (platform == 'win32') {

@@ -630,0 +637,0 @@ fileName = "_win_" + electronVersion[0];

{
"name": "ibm_db",
"description": "IBM DB2 and IBM Informix bindings for node",
"version": "3.2.5",
"version": "3.3.0",
"main": "lib/odbc.js",

@@ -6,0 +6,0 @@ "homepage": "https://github.com/ibmdb/node-ibm_db/",

@@ -6,8 +6,10 @@ # node-ibm_db

- **Supported Platforms** - Windows64, MacOS64, Linuxx64, Linuxia32, AIX, Linux on IBM Z, Linux on Power PC and z/OS.
- **Supported Platforms** - Windows64, MacOS64, MacARM64, Linuxx64, Linuxia32, AIX, Linux on IBM Z, Linux on Power PC and z/OS.
- **MacOS with M1 Chip** - Install x64 version of node.js. ibm_db with arm64 version of node.js is not supported.
- **MacOS with Silicon Chip** - Supported from ibm_db@3.3.0 onwards using v12.x clidriver.
- **Steps to install ibm_db on MacOS M1/M2 Chip system (arm64 architecture)** - Check [here](https://github.com/ibmdb/node-ibm_db/blob/master/INSTALL.md#m1chip).
- **MacOS with Intel Chip** - Supported using v11.x clidriver only. By default v11.5.9 clidriver will get downloaded.
- ibm_db v3.2.5 is the last version to use clidriver of version 11.5.9 by default. **ibm_db@3.3.0** onwards v12.1.x clidriver get autodownloaded by default and hence v12.1 db2connect license is required. However, user can use older db2connect license when ibm_db get installed using `npm install ibm_db -clidriver="v11.5.9"` command.
- **SQL1598N Error** - It is expected in absence of valid db2connect license. Please click [here](#sql1598n) and read instructions.

@@ -170,3 +172,4 @@

| | others |aix64_odbc_cli.tar.gz | Yes |
|Darwin | x64 |macos64_odbc_cli.tar.gz | Yes |
|Darwin | x64 |macos64_odbc_cli.tar.gz | Till v11.5.9|
|Darwin | arm64 |macarm64_odbc_cli.tar.gz | From v12.1.0|
|Linux | x64 |linuxx64_odbc_cli.tar.gz | Yes |

@@ -183,4 +186,2 @@ | | s390x |s390x64_odbc_cli.tar.gz | Yes |

* For MacOS M1 Chip system with arm64 architecture, install x64 version of node.js and gcc@8. ibm_db with arm64 version of node.js is not supported. For installation instruction, check [here](https://github.com/ibmdb/node-ibm_db/blob/master/INSTALL.md#m1chip).
### Configure ODBC driver on z/OS

@@ -376,4 +377,10 @@

- Db2connect license can be applied on database server or client side. A **db2connect license of version 11.5** is required for ibm_db.
- Db2connect license can be applied on database server or client side. A **db2connect license of version 12.1** is required for ibm_db.
- If you have db2connect license of **Db2 V11.5**, then install ibm_db using `npm install ibm_db -clidriver=v11.5.9` command or use below commands:
```
npm config set clidriver=v11.5.9
npm install ibm_db
```
- Ask your DBA to run db2connectactivate utility on Server to activate db2connect license.

@@ -463,2 +470,7 @@

If you know the electron version or get it from `Help->About` option of vscode; you can build native add-on code for specific version of electron using below command:
```
npm install ibm_db -electron="32.2.5"
```
## How to verify database connectivity using ODBC and generate db2trace?

@@ -465,0 +477,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.