typeorm 0.3.22-dev.206af0a → 0.3.22-dev.673b6ce

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 (37) hide show
  1. package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js +6 -9
  2. package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
  3. package/browser/driver/aurora-postgres/AuroraPostgresQueryRunner.js +6 -9
  4. package/browser/driver/aurora-postgres/AuroraPostgresQueryRunner.js.map +1 -1
  5. package/browser/driver/cockroachdb/CockroachQueryRunner.js +7 -11
  6. package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  7. package/browser/driver/mysql/MysqlQueryRunner.js +6 -9
  8. package/browser/driver/mysql/MysqlQueryRunner.js.map +1 -1
  9. package/browser/driver/oracle/OracleQueryRunner.js +4 -6
  10. package/browser/driver/oracle/OracleQueryRunner.js.map +1 -1
  11. package/browser/driver/postgres/PostgresQueryRunner.js +6 -9
  12. package/browser/driver/postgres/PostgresQueryRunner.js.map +1 -1
  13. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +6 -9
  14. package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  15. package/browser/driver/sqlserver/SqlServerQueryRunner.js +5 -6
  16. package/browser/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  17. package/browser/query-builder/RelationIdLoader.js +3 -2
  18. package/browser/query-builder/RelationIdLoader.js.map +1 -1
  19. package/driver/aurora-mysql/AuroraMysqlQueryRunner.js +6 -9
  20. package/driver/aurora-mysql/AuroraMysqlQueryRunner.js.map +1 -1
  21. package/driver/aurora-postgres/AuroraPostgresQueryRunner.js +6 -9
  22. package/driver/aurora-postgres/AuroraPostgresQueryRunner.js.map +1 -1
  23. package/driver/cockroachdb/CockroachQueryRunner.js +7 -11
  24. package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
  25. package/driver/mysql/MysqlQueryRunner.js +6 -9
  26. package/driver/mysql/MysqlQueryRunner.js.map +1 -1
  27. package/driver/oracle/OracleQueryRunner.js +4 -6
  28. package/driver/oracle/OracleQueryRunner.js.map +1 -1
  29. package/driver/postgres/PostgresQueryRunner.js +6 -9
  30. package/driver/postgres/PostgresQueryRunner.js.map +1 -1
  31. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js +6 -9
  32. package/driver/sqlite-abstract/AbstractSqliteQueryRunner.js.map +1 -1
  33. package/driver/sqlserver/SqlServerQueryRunner.js +5 -6
  34. package/driver/sqlserver/SqlServerQueryRunner.js.map +1 -1
  35. package/package.json +1 -1
  36. package/query-builder/RelationIdLoader.js +3 -2
  37. package/query-builder/RelationIdLoader.js.map +1 -1
@@ -119,16 +119,15 @@ class PostgresQueryRunner extends BaseQueryRunner_1.BaseQueryRunner {
119
119
  throw err;
120
120
  }
121
121
  if (this.transactionDepth === 0) {
122
- this.transactionDepth += 1;
123
122
  await this.query("START TRANSACTION");
124
123
  if (isolationLevel) {
125
124
  await this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel);
126
125
  }
127
126
  }
128
127
  else {
129
- this.transactionDepth += 1;
130
- await this.query(`SAVEPOINT typeorm_${this.transactionDepth - 1}`);
128
+ await this.query(`SAVEPOINT typeorm_${this.transactionDepth}`);
131
129
  }
130
+ this.transactionDepth += 1;
132
131
  await this.broadcaster.broadcast("AfterTransactionStart");
133
132
  }
134
133
  /**
@@ -140,14 +139,13 @@ class PostgresQueryRunner extends BaseQueryRunner_1.BaseQueryRunner {
140
139
  throw new TransactionNotStartedError_1.TransactionNotStartedError();
141
140
  await this.broadcaster.broadcast("BeforeTransactionCommit");
142
141
  if (this.transactionDepth > 1) {
143
- this.transactionDepth -= 1;
144
- await this.query(`RELEASE SAVEPOINT typeorm_${this.transactionDepth}`);
142
+ await this.query(`RELEASE SAVEPOINT typeorm_${this.transactionDepth - 1}`);
145
143
  }
146
144
  else {
147
- this.transactionDepth -= 1;
148
145
  await this.query("COMMIT");
149
146
  this.isTransactionActive = false;
150
147
  }
148
+ this.transactionDepth -= 1;
151
149
  await this.broadcaster.broadcast("AfterTransactionCommit");
152
150
  }
153
151
  /**
@@ -159,14 +157,13 @@ class PostgresQueryRunner extends BaseQueryRunner_1.BaseQueryRunner {
159
157
  throw new TransactionNotStartedError_1.TransactionNotStartedError();
160
158
  await this.broadcaster.broadcast("BeforeTransactionRollback");
161
159
  if (this.transactionDepth > 1) {
162
- this.transactionDepth -= 1;
163
- await this.query(`ROLLBACK TO SAVEPOINT typeorm_${this.transactionDepth}`);
160
+ await this.query(`ROLLBACK TO SAVEPOINT typeorm_${this.transactionDepth - 1}`);
164
161
  }
165
162
  else {
166
- this.transactionDepth -= 1;
167
163
  await this.query("ROLLBACK");
168
164
  this.isTransactionActive = false;
169
165
  }
166
+ this.transactionDepth -= 1;
170
167
  await this.broadcaster.broadcast("AfterTransactionRollback");
171
168
  }
172
169
  /**