@bdkinc/knex-ibmi 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -478,7 +478,9 @@ var DB2Client = class extends import_knex.knex.Client {
478
478
  obj.response = { rows: result, rowCount: result.count };
479
479
  }
480
480
  } catch (err) {
481
- this.printError(err);
481
+ this.printDebug(err);
482
+ console.error(err);
483
+ throw new Error(err);
482
484
  }
483
485
  }
484
486
  this.printDebug(obj);
@@ -504,6 +506,10 @@ var DB2Client = class extends import_knex.knex.Client {
504
506
  return null;
505
507
  const resp = obj.response;
506
508
  const method = obj.sqlMethod;
509
+ console.log({ obj });
510
+ if (!resp) {
511
+ this.printDebug("response undefined" + obj);
512
+ }
507
513
  const { rows, rowCount } = resp;
508
514
  if (obj.output)
509
515
  return obj.output.call(runner, resp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bdkinc/knex-ibmi",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Knex dialect for IBMi",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -9,7 +9,7 @@
9
9
  "/src"
10
10
  ],
11
11
  "engines": {
12
- "node": ">=14"
12
+ "node": ">=16"
13
13
  },
14
14
  "scripts": {
15
15
  "build": "tsup src/index.ts --dts",
package/src/index.ts CHANGED
@@ -154,7 +154,7 @@ class DB2Client extends knex.Client {
154
154
  // IDENTITY column
155
155
  if (result.statement.includes("IDENTITY_VAL_LOCAL()")) {
156
156
  obj.response = {
157
- rows: result.map((row: { [x: string]: any; }) =>
157
+ rows: result.map((row: { [x: string]: any }) =>
158
158
  result.columns && result.columns?.length > 0
159
159
  ? row[result.columns[0].name]
160
160
  : row,
@@ -178,7 +178,9 @@ class DB2Client extends knex.Client {
178
178
  obj.response = { rows: result, rowCount: result.count };
179
179
  }
180
180
  } catch (err: any) {
181
- this.printError(err);
181
+ this.printDebug(err);
182
+ console.error(err)
183
+ throw new Error(err)
182
184
  }
183
185
  }
184
186
 
@@ -217,6 +219,10 @@ class DB2Client extends knex.Client {
217
219
 
218
220
  const resp = obj.response;
219
221
  const method = obj.sqlMethod;
222
+ console.log({ obj });
223
+ if (!resp) {
224
+ this.printDebug("response undefined" + obj);
225
+ }
220
226
  const { rows, rowCount } = resp;
221
227
 
222
228
  if (obj.output) return obj.output.call(runner, resp);