bellboy 8.7.5 → 8.7.6

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.
@@ -10,21 +10,38 @@ class FirebirdProcessor extends database_processor_1.DatabaseProcessor {
10
10
  this.connection = config.connection;
11
11
  }
12
12
  async process(processStream) {
13
- const Firebird = this.connection.useClavizNodeFirebird ? require('claviz-node-firebird') : require('node-firebird');
13
+ const Firebird = this.connection.useClavizNodeFirebird
14
+ ? require('claviz-node-firebird')
15
+ : require('node-firebird');
14
16
  const db = await new Promise((resolve, reject) => {
15
17
  Firebird.attach(this.connection, (err, db) => {
16
- if (err)
18
+ if (err) {
17
19
  reject(err);
18
- else
20
+ }
21
+ else {
19
22
  resolve(db);
23
+ }
20
24
  });
21
25
  });
26
+ let resume = null;
22
27
  const stream = new stream_1.Readable({
23
28
  objectMode: true,
24
- read() { }
29
+ read() {
30
+ if (resume) {
31
+ const r = resume;
32
+ resume = null;
33
+ r();
34
+ }
35
+ }
25
36
  });
26
37
  db.sequentially(this.query, [], (row) => {
27
- if (!stream.push(row)) { }
38
+ const ok = stream.push(row);
39
+ if (ok) {
40
+ return;
41
+ }
42
+ return new Promise((resolve) => {
43
+ resume = resolve;
44
+ });
28
45
  }, (err) => {
29
46
  if (err) {
30
47
  stream.emit('error', err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bellboy",
3
- "version": "8.7.5",
3
+ "version": "8.7.6",
4
4
  "description": "Highly performant JavaScript data stream ETL engine.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index",
@@ -53,7 +53,7 @@
53
53
  "dependencies": {
54
54
  "async-mqtt": "2.2.1",
55
55
  "axios": "1.8.4",
56
- "claviz-node-firebird": "2.0.2",
56
+ "claviz-node-firebird": "2.0.3",
57
57
  "csv": "6.0.5",
58
58
  "iconv-lite": "0.6.3",
59
59
  "mssql": "11.0.1",