@igojs/db 6.0.0-beta.1 → 6.0.0-beta.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Db.js +6 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igojs/db",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.2",
4
4
  "description": "Igo ORM - Database abstraction layer for MySQL and PostgreSQL",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Db.js CHANGED
@@ -135,6 +135,12 @@ class Db {
135
135
  //
136
136
  async rollbackTransaction() {
137
137
  const { driver, TEST_ENV } = this;
138
+
139
+ // No connection = no transaction to rollback
140
+ if (TEST_ENV && !this.connection) {
141
+ return;
142
+ }
143
+
138
144
  const { connection } = await this.getConnection();
139
145
  await driver.rollback(connection);
140
146
  driver.release(connection);