bellboy 6.5.1 → 6.6.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.
@@ -90,7 +90,7 @@ var MssqlProcessor = /** @class */ (function (_super) {
90
90
  case 4: return [3 /*break*/, 6];
91
91
  case 5: return [2 /*return*/, this.push(null)];
92
92
  case 6:
93
- rowData = data.shift();
93
+ rowData = data.shift() || null;
94
94
  this.push(rowData);
95
95
  return [2 /*return*/];
96
96
  }
@@ -103,6 +103,14 @@ var MssqlProcessor = /** @class */ (function (_super) {
103
103
  case 1:
104
104
  db = _a.sent();
105
105
  dbRequest = db.request();
106
+ dbRequest.on('error', function (err) {
107
+ if (err.code !== 'ECANCEL') {
108
+ readStream.emit('error', err);
109
+ }
110
+ });
111
+ readStream.on('close', function () {
112
+ dbRequest.cancel();
113
+ });
106
114
  dbRequest.stream = true;
107
115
  dbRequest.query(this.query);
108
116
  processRows = function () { return __awaiter(_this, void 0, void 0, function () {
@@ -118,7 +126,7 @@ var MssqlProcessor = /** @class */ (function (_super) {
118
126
  return __awaiter(this, void 0, void 0, function () {
119
127
  return __generator(this, function (_a) {
120
128
  data.push(row);
121
- if (data.length >= 10000) {
129
+ if (data.length >= 1000) {
122
130
  dbRequest.pause();
123
131
  removeListeners();
124
132
  resolve();
@@ -163,6 +171,9 @@ var MssqlProcessor = /** @class */ (function (_super) {
163
171
  dbRequest.pause();
164
172
  return [4 /*yield*/, processStream(readStream)];
165
173
  case 2:
174
+ _a.sent();
175
+ return [4 /*yield*/, db.close()];
176
+ case 3:
166
177
  _a.sent();
167
178
  return [2 /*return*/];
168
179
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bellboy",
3
- "version": "6.5.1",
3
+ "version": "6.6.2",
4
4
  "description": "Highly performant JavaScript data stream ETL engine.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@types/axios": "^0.14.0",
31
31
  "@types/jest": "^25.2.1",
32
- "@types/mssql": "^6.0.7",
32
+ "@types/mssql": "^7.1.5",
33
33
  "@types/node": "^14.10.2",
34
34
  "@types/request-promise": "^4.1.43",
35
35
  "@types/shortid": "0.0.29",
@@ -48,7 +48,7 @@
48
48
  "async-mqtt": "^2.2.1",
49
49
  "axios": "^0.21.1",
50
50
  "csv": "^6.0.5",
51
- "mssql": "^6.3.1",
51
+ "mssql": "8.1.0",
52
52
  "pg": "8.0.3",
53
53
  "pg-promise": "10.5.3",
54
54
  "pg-query-stream": "3.0.7",