bellboy 8.1.0 → 8.1.2
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.
|
@@ -54,7 +54,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.MySqlDestination = void 0;
|
|
56
56
|
var database_destination_1 = require("./base/database-destination");
|
|
57
|
-
var promise_1 = __importDefault(require("mysql2/promise"));
|
|
57
|
+
var promise_1 = __importDefault(require("mysql2-stream-fix/promise"));
|
|
58
58
|
var MySqlDestination = /** @class */ (function (_super) {
|
|
59
59
|
__extends(MySqlDestination, _super);
|
|
60
60
|
function MySqlDestination(config) {
|
package/lib/job.js
CHANGED
|
@@ -90,12 +90,14 @@ var Job = /** @class */ (function () {
|
|
|
90
90
|
case 4:
|
|
91
91
|
this.settingReporterEvents = false;
|
|
92
92
|
this.stop = function (message) {
|
|
93
|
-
_this.stopped
|
|
94
|
-
|
|
95
|
-
readStream.
|
|
96
|
-
|
|
93
|
+
if (!_this.stopped) {
|
|
94
|
+
_this.stopped = true;
|
|
95
|
+
if (readStream && (readStream instanceof stream_1.Readable)) {
|
|
96
|
+
readStream.emit('end');
|
|
97
|
+
readStream.destroy();
|
|
98
|
+
}
|
|
99
|
+
errorMessage = message;
|
|
97
100
|
}
|
|
98
|
-
errorMessage = message;
|
|
99
101
|
};
|
|
100
102
|
return [4 /*yield*/, this.emit('startProcessing', this.processor, this.destinations)];
|
|
101
103
|
case 5:
|
|
@@ -53,9 +53,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
55
|
exports.MySqlProcessor = void 0;
|
|
56
|
-
var stream_1 = require("stream");
|
|
57
56
|
var database_processor_1 = require("./base/database-processor");
|
|
58
|
-
var promise_1 = __importDefault(require("mysql2/promise"));
|
|
57
|
+
var promise_1 = __importDefault(require("mysql2-stream-fix/promise"));
|
|
59
58
|
var MySqlProcessor = /** @class */ (function (_super) {
|
|
60
59
|
__extends(MySqlProcessor, _super);
|
|
61
60
|
function MySqlProcessor(config) {
|
|
@@ -65,35 +64,13 @@ var MySqlProcessor = /** @class */ (function (_super) {
|
|
|
65
64
|
}
|
|
66
65
|
MySqlProcessor.prototype.process = function (processStream) {
|
|
67
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
-
var dbConnection, query
|
|
67
|
+
var dbConnection, query;
|
|
69
68
|
return __generator(this, function (_a) {
|
|
70
69
|
switch (_a.label) {
|
|
71
70
|
case 0:
|
|
72
71
|
dbConnection = promise_1.default.createPool(this.connection);
|
|
73
|
-
query = dbConnection.pool.query(this.query);
|
|
74
|
-
|
|
75
|
-
stream._read = function () {
|
|
76
|
-
//dbConnection && dbConnection.resume();
|
|
77
|
-
};
|
|
78
|
-
query.on('result', function (row) {
|
|
79
|
-
if (!stream.push(row)) {
|
|
80
|
-
dbConnection.pause();
|
|
81
|
-
}
|
|
82
|
-
stream.emit('result', row);
|
|
83
|
-
});
|
|
84
|
-
query.on('error', function (err) {
|
|
85
|
-
stream.emit('error', err);
|
|
86
|
-
});
|
|
87
|
-
query.on('end', function () {
|
|
88
|
-
stream.push(null);
|
|
89
|
-
setImmediate(function () {
|
|
90
|
-
stream.emit('close');
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
query.on('fields', function (fields) {
|
|
94
|
-
stream.emit('fields', fields);
|
|
95
|
-
});
|
|
96
|
-
return [4 /*yield*/, processStream(stream)];
|
|
72
|
+
query = dbConnection.pool.query(this.query).stream();
|
|
73
|
+
return [4 /*yield*/, processStream(query)];
|
|
97
74
|
case 1:
|
|
98
75
|
_a.sent();
|
|
99
76
|
return [4 /*yield*/, dbConnection.end()];
|
package/lib/utils.js
CHANGED
|
@@ -90,7 +90,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
90
90
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
91
91
|
exports.applyHttpAuthorization = exports.getDelimitedGenerator = exports.removeCircularReferencesFromChunk = exports.getValueFromJSONChunk = exports.closeDbConnection = exports.getDb = void 0;
|
|
92
92
|
var axios_1 = __importDefault(require("axios"));
|
|
93
|
-
var promise_1 = __importDefault(require("mysql2/promise"));
|
|
93
|
+
var promise_1 = __importDefault(require("mysql2-stream-fix/promise"));
|
|
94
94
|
var stream_1 = require("stream");
|
|
95
95
|
var cachedDbConnections = new Map();
|
|
96
96
|
function getCachedDbConnection(databaseConfig) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bellboy",
|
|
3
|
-
"version": "8.1.
|
|
3
|
+
"version": "8.1.2",
|
|
4
4
|
"description": "Highly performant JavaScript data stream ETL engine.",
|
|
5
5
|
"main": "lib/index",
|
|
6
6
|
"types": "lib/index",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"axios": "^0.21.1",
|
|
56
56
|
"csv": "^6.0.5",
|
|
57
57
|
"mssql": "8.1.0",
|
|
58
|
-
"mysql2": "^3.
|
|
58
|
+
"mysql2-stream-fix": "^3.9.1",
|
|
59
59
|
"pg": "8.0.3",
|
|
60
60
|
"pg-promise": "10.5.3",
|
|
61
61
|
"pg-query-stream": "3.0.7",
|