Skip to content

Commit 36b024e

Browse files
committed
refactor: idb transport to use bindParameters
1 parent 322dd42 commit 36b024e

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

lib/transports/idbTransport.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
const idbCall = (config, xmlInput, cb) => {
1919
const {
20-
dbconn, dbstmt, IN, CLOB, CHAR, SQL_ATTR_DBC_SYS_NAMING, SQL_FALSE,
20+
dbconn, dbstmt, SQL_ATTR_DBC_SYS_NAMING, SQL_FALSE,
2121
// idb-connector is an optional dependency, since users may not use this transport
2222
// thus we can't globally require it
2323
// eslint-disable-next-line max-len
@@ -58,12 +58,6 @@ const idbCall = (config, xmlInput, cb) => {
5858
// eslint-disable-next-line new-cap
5959
const stmt = new dbstmt(conn);
6060

61-
const parameters = [
62-
[ipc, IN, CHAR],
63-
[ctl, IN, CHAR],
64-
[xmlInput, IN, CLOB],
65-
];
66-
6761
// Before returning to caller, we must clean up
6862
const done = (err, val) => {
6963
stmt.close();
@@ -78,7 +72,7 @@ const idbCall = (config, xmlInput, cb) => {
7872
done(prepareError, null);
7973
return;
8074
}
81-
stmt.bindParam(parameters, (bindError) => {
75+
stmt.bindParameters([ipc, ctl, xmlInput], (bindError) => {
8276
if (bindError) {
8377
done(bindError, null);
8478
return;

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"standard-version": "^8.0.1"
5555
},
5656
"optionalDependencies": {
57-
"idb-connector": "^1.2.2",
57+
"idb-connector": "^1.2.9",
5858
"idb-pconnector": "^1.0.7",
5959
"ssh2": "^0.8.2",
6060
"odbc": "^2.1.3"

0 commit comments

Comments
 (0)