@bdkinc/knex-ibmi 0.3.15 → 0.3.17
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 +24 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -462,26 +462,35 @@ var DB2Client = class extends import_knex.knex.Client {
|
|
|
462
462
|
fetchSize: options?.fetchSize || 1
|
|
463
463
|
},
|
|
464
464
|
(error, cursor) => {
|
|
465
|
-
const printError = this.printError;
|
|
466
465
|
if (error) {
|
|
467
466
|
this.printError(JSON.stringify(error, null, 2));
|
|
468
467
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
468
|
+
const readableStream = new import_node_stream.Readable({
|
|
469
|
+
objectMode: true,
|
|
470
|
+
read() {
|
|
471
|
+
cursor.fetch((error2, result) => {
|
|
472
|
+
if (error2) {
|
|
473
|
+
console.log(JSON.stringify(error2, null, 2));
|
|
474
|
+
}
|
|
475
|
+
if (!cursor.noData) {
|
|
476
|
+
this.push(result);
|
|
477
|
+
} else {
|
|
478
|
+
this.push(null);
|
|
479
|
+
console.log({ result });
|
|
480
|
+
cursor.close((error3) => {
|
|
481
|
+
if (error3) {
|
|
482
|
+
console.log(JSON.stringify(error3, null, 2));
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
});
|
|
472
487
|
}
|
|
473
|
-
const readableStream = new import_node_stream.Readable({
|
|
474
|
-
objectMode: true,
|
|
475
|
-
read() {
|
|
476
|
-
this.push(result);
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
readableStream.on("error", (err) => {
|
|
480
|
-
reject(err);
|
|
481
|
-
stream.emit("error", err);
|
|
482
|
-
});
|
|
483
|
-
readableStream.pipe(stream);
|
|
484
488
|
});
|
|
489
|
+
readableStream.on("error", (err) => {
|
|
490
|
+
reject(err);
|
|
491
|
+
stream.emit("error", err);
|
|
492
|
+
});
|
|
493
|
+
readableStream.pipe(stream);
|
|
485
494
|
}
|
|
486
495
|
);
|
|
487
496
|
});
|