@dascompany/database 4.2.0 → 4.2.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.
@@ -8,4 +8,5 @@ export default class Connection {
8
8
  beginTransaction(): Promise<void>;
9
9
  commitTransaction(): Promise<void>;
10
10
  rollBackTransaction(): Promise<void>;
11
+ release(): void;
11
12
  }
@@ -16,7 +16,7 @@ export default class Connection {
16
16
  throw new Error('No active transaction to commit');
17
17
  }
18
18
  await this.poolClient.query('COMMIT');
19
- this.poolClient.release();
19
+ this.release();
20
20
  this.activeTransaction = false;
21
21
  }
22
22
  async rollBackTransaction() {
@@ -24,7 +24,11 @@ export default class Connection {
24
24
  throw new Error('No active transaction to roll back');
25
25
  }
26
26
  await this.poolClient.query('ROLLBACK');
27
- this.poolClient.release();
27
+ this.release();
28
28
  this.activeTransaction = false;
29
29
  }
30
+ release() {
31
+ if (this.poolClient)
32
+ this.poolClient.release();
33
+ }
30
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/database",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {