Skip to content

Commit

Permalink
add support for nodev22.x on Windows #1005
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalkjha committed Oct 7, 2024
1 parent 863fc46 commit 52573c5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,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: **21.2.0**
- The latest node.js version using which `ibm_db` is tested: **22.9.0**

## Install

Expand Down
Binary file modified build.zip
Binary file not shown.
4 changes: 3 additions & 1 deletion installer/driverInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ var install_node_ibm_db = function(file_url) {
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_V19 = 'build\/Release\/odbc_bindings.node.19.9.0';
var ODBC_BINDINGS_V20 = 'build\/Release\/odbc_bindings.node.20.12.2';
var ODBC_BINDINGS_V20 = 'build\/Release\/odbc_bindings.node.20.18.0';
var ODBC_BINDINGS_V21 = 'build\/Release\/odbc_bindings.node.21.7.3';

// 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) {
Expand All @@ -671,6 +672,7 @@ var install_node_ibm_db = function(file_url) {
(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 ||
ODBC_BINDINGS;
}
// We have correct bindings file in odbcBindingsNode for
Expand Down
10 changes: 5 additions & 5 deletions src/odbc_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ NAN_METHOD(ODBCConnection::Open)
DEBUG_PRINTF("ODBCConnection::Open - Entry\n");
Nan::HandleScope scope;
int len = 0;
char *errmsg = NULL;
const char *errmsg = NULL;

REQ_STRO_ARG(0, connection);
REQ_FUN_ARG(1, cb);
Expand Down Expand Up @@ -640,7 +640,7 @@ NAN_METHOD(ODBCConnection::CreateDbSync)
SQLRETURN ret;
Local<Value> objError;
bool err = false;
char *errmsg = NULL;
const char *errmsg = NULL;

int dbNameLength = 0;
int codeSetLength = 0;
Expand Down Expand Up @@ -953,7 +953,7 @@ NAN_METHOD(ODBCConnection::Query)

Local<Function> cb;
int len = 0;
char *errmsg = NULL;
const char *errmsg = NULL;
uv_work_t* work_req = NULL;
query_work_data* data = NULL;

Expand Down Expand Up @@ -1463,7 +1463,7 @@ NAN_METHOD(ODBCConnection::Tables)
DEBUG_PRINTF("ODBCConnection::Tables - Entry\n");
Nan::HandleScope scope;
int len = 0;
char *errmsg = NULL;
const char *errmsg = NULL;
uv_work_t* work_req = NULL;
query_work_data* data = NULL;

Expand Down Expand Up @@ -1572,7 +1572,7 @@ NAN_METHOD(ODBCConnection::Columns)
DEBUG_PRINTF("ODBCConnection::Columns - Entry\n");
Nan::HandleScope scope;
int len = 0;
char *errmsg = NULL;
const char *errmsg = NULL;
uv_work_t* work_req = NULL;
query_work_data* data = NULL;

Expand Down
2 changes: 1 addition & 1 deletion src/odbc_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ NAN_METHOD(ODBCResult::GetColumnMetadataSync)
Nan::Set(col, Nan::New("index").ToLocalChecked(), Nan::New(self->columns[i].index));
Nan::Set(col, Nan::New("SQL_DESC_NAME").ToLocalChecked(), Nan::New((const char *) self->columns[i].name).ToLocalChecked());
Nan::Set(col, Nan::New("SQL_DESC_TYPE_NAME").ToLocalChecked(), Nan::New((const char *) self->columns[i].type_name).ToLocalChecked());
Nan::Set(col, Nan::New("SQL_DESC_CONSIZE_TYPE").ToLocalChecked(), Nan::New(self->columns[i].type));
Nan::Set(col, Nan::New("SQL_DESC_CONSIZE_TYPE").ToLocalChecked(), Nan::New((int32_t)self->columns[i].type));
Nan::Set(col, Nan::New("SQL_DESC_DISPLAY_SIZE").ToLocalChecked(), Nan::New(self->columns[i].max_display_len));
Nan::Set(col, Nan::New("SQL_DESC_PRECISION").ToLocalChecked(), Nan::New(self->columns[i].precision));
Nan::Set(col, Nan::New("SQL_DESC_SCALE").ToLocalChecked(), Nan::New(self->columns[i].scale));
Expand Down

0 comments on commit 52573c5

Please sign in to comment.