bellboy 8.7.0 → 8.7.1

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.
@@ -31,30 +31,28 @@ class MySqlDestination extends database_destination_1.DatabaseDestination {
31
31
  }
32
32
  const insertQuery = `INSERT INTO ${this.table} (${columnNames.join(', ')}) VALUES ?`;
33
33
  await dbConnection.beginTransaction();
34
+ let result;
34
35
  try {
35
36
  const insertData = data.map(row => columnNames.map(column => row[column.replace(/`/g, '')]));
36
37
  await dbConnection.query(insertQuery, [insertData]);
37
38
  await dbConnection.commit();
39
+ if (this.postLoadQuery) {
40
+ result = await dbConnection.query(this.postLoadQuery);
41
+ }
38
42
  }
39
43
  catch (err) {
40
44
  await dbConnection.rollback();
41
45
  throw err;
42
46
  }
43
47
  finally {
44
- let result;
45
48
  try {
46
- if (this.postLoadQuery) {
47
- result = await dbConnection.query(this.postLoadQuery);
48
- }
49
- }
50
- catch (postLoadError) {
51
- throw postLoadError;
52
- }
53
- finally {
54
49
  await pool.end();
55
50
  }
56
- return result;
51
+ catch (poolCloseError) {
52
+ throw poolCloseError;
53
+ }
57
54
  }
55
+ return result;
58
56
  }
59
57
  }
60
58
  exports.MySqlDestination = MySqlDestination;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bellboy",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "description": "Highly performant JavaScript data stream ETL engine.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index",