Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for NAPI 7 and below #398

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@
"host": "https://github.com/markdirish/node-odbc/releases/download/v{version}",
"package_name": "{name}-v{version}-{platform}-{arch}-napi-v{napi_build_version}.tar.gz",
"napi_versions": [
3,
4,
5,
6
8
]
}
}
2 changes: 0 additions & 2 deletions src/odbc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,14 +705,12 @@ void ODBC::StoreBindValues(Napi::Array *values, Parameter **parameters) {
parameter->ValueType = SQL_C_DEFAULT;
parameter->ParameterValuePtr = NULL;
parameter->StrLen_or_IndPtr = SQL_NULL_DATA;
#if NAPI_VERSION > 5
} else if (value.IsBigInt()) {
// TODO: need to check for signed/unsigned?
bool lossless = true;
parameter->ValueType = SQL_C_SBIGINT;
parameter->ParameterValuePtr = new SQLBIGINT(value.As<Napi::BigInt>().Int64Value(&lossless));
parameter->isbigint = true;
#endif
} else if (value.IsNumber()) {
double double_val = value.As<Napi::Number>().DoubleValue();
int64_t int_val = value.As<Napi::Number>().Int64Value();
Expand Down
13 changes: 0 additions & 13 deletions src/odbc_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,6 @@ void ODBCConnection::ParametersToArray(Napi::Reference<Napi::Array> *napiParamet
value = Napi::Number::New(env, *(SQLUINTEGER*)parameter->ParameterValuePtr);
break;
// Napi::BigInt
#if NAPI_VERSION > 5
case SQL_C_SBIGINT:
if (parameter->isbigint == true) {
value = Napi::BigInt::New(env, *(int64_t*)parameter->ParameterValuePtr);
Expand All @@ -1195,14 +1194,6 @@ void ODBCConnection::ParametersToArray(Napi::Reference<Napi::Array> *napiParamet
value = Napi::Number::New(env, *(uint64_t*)parameter->ParameterValuePtr);
}
break;
#else
case SQL_C_SBIGINT:
value = Napi::Number::New(env, *(int64_t*)parameter->ParameterValuePtr);
break;
case SQL_C_UBIGINT:
value = Napi::Number::New(env, *(uint64_t*)parameter->ParameterValuePtr);
break;
#endif
case SQL_C_SSHORT:
value = Napi::Number::New(env, *(signed short*)parameter->ParameterValuePtr);
break;
Expand Down Expand Up @@ -4204,11 +4195,7 @@ Napi::Array process_data_for_napi(Napi::Env env, StatementData *data, Napi::Arra
case SQL_BIGINT:
switch(columns[j]->bind_type) {
case SQL_C_SBIGINT:
#if NAPI_VERSION > 5
value = Napi::BigInt::New(env, (int64_t)storedRow[j].bigint_data);
#else
value = Napi::Number::New(env, (int64_t)storedRow[j].bigint_data);
#endif
break;
default:
value = Napi::String::New(env, (char*)storedRow[j].char_data);
Expand Down
Loading