Skip to content

Commit

Permalink
refactor: improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelafuentesales committed Feb 21, 2024
1 parent 2ceac68 commit 622d373
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/driver/spanner/SpannerQueryRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,16 @@ export class SpannerQueryRunner extends BaseQueryRunner implements QueryRunner {
]
| undefined = undefined
const isSelect = query.startsWith("SELECT")
if (!isSelect && !this.isTransactionActive) {
if (!this.isTransactionActive && !isSelect) {
await this.initTransaction()
await this.currentTransaction.begin()
}

const executor =
isSelect && !this.isTransactionActive
? this.driver.instanceDatabase
: this.currentTransaction

if (!this.isTransactionActive && !isSelect) {
await this.currentTransaction.begin()
}

try {
this.driver.connection.logger.logQuery(query, parameters, this)
rawResult = await executor.run({
Expand Down

0 comments on commit 622d373

Please sign in to comment.