typeorm 0.3.22-dev.206af0a → 0.3.22-dev.513be33

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
@@ -116,16 +116,15 @@ export class PostgresQueryRunner extends BaseQueryRunner {
116
116
  throw err;
117
117
  }
118
118
  if (this.transactionDepth === 0) {
119
- this.transactionDepth += 1;
120
119
  await this.query("START TRANSACTION");
121
120
  if (isolationLevel) {
122
121
  await this.query("SET TRANSACTION ISOLATION LEVEL " + isolationLevel);
123
122
  }
124
123
  }
125
124
  else {
126
- this.transactionDepth += 1;
127
- await this.query(`SAVEPOINT typeorm_${this.transactionDepth - 1}`);
125
+ await this.query(`SAVEPOINT typeorm_${this.transactionDepth}`);
128
126
  }
127
+ this.transactionDepth += 1;
129
128
  await this.broadcaster.broadcast("AfterTransactionStart");
130
129
  }
131
130
  /**
@@ -137,14 +136,13 @@ export class PostgresQueryRunner extends BaseQueryRunner {
137
136
  throw new TransactionNotStartedError();
138
137
  await this.broadcaster.broadcast("BeforeTransactionCommit");
139
138
  if (this.transactionDepth > 1) {
140
- this.transactionDepth -= 1;
141
- await this.query(`RELEASE SAVEPOINT typeorm_${this.transactionDepth}`);
139
+ await this.query(`RELEASE SAVEPOINT typeorm_${this.transactionDepth - 1}`);
142
140
  }
143
141
  else {
144
- this.transactionDepth -= 1;
145
142
  await this.query("COMMIT");
146
143
  this.isTransactionActive = false;
147
144
  }
145
+ this.transactionDepth -= 1;
148
146
  await this.broadcaster.broadcast("AfterTransactionCommit");
149
147
  }
150
148
  /**
@@ -156,14 +154,13 @@ export class PostgresQueryRunner extends BaseQueryRunner {
156
154
  throw new TransactionNotStartedError();
157
155
  await this.broadcaster.broadcast("BeforeTransactionRollback");
158
156
  if (this.transactionDepth > 1) {
159
- this.transactionDepth -= 1;
160
- await this.query(`ROLLBACK TO SAVEPOINT typeorm_${this.transactionDepth}`);
157
+ await this.query(`ROLLBACK TO SAVEPOINT typeorm_${this.transactionDepth - 1}`);
161
158
  }
162
159
  else {
163
- this.transactionDepth -= 1;
164
160
  await this.query("ROLLBACK");
165
161
  this.isTransactionActive = false;
166
162
  }
163
+ this.transactionDepth -= 1;
167
164
  await this.broadcaster.broadcast("AfterTransactionRollback");
168
165
  }
169
166
  /**