@@ -24,7 +24,6 @@ import {IsolationLevel} from "../types/IsolationLevel.ts";
2424import { PostgresDriver } from "./PostgresDriver.ts" ;
2525import { PoolClient , QueryArrayResult } from "./typings.ts" ;
2626import { NotImplementedError } from "../../error/NotImplementedError.ts" ;
27- import { PromiseQueue } from "../../util/PromiseQueue.ts" ;
2827
2928/**
3029 * Runs queries on a single postgres database connection.
@@ -156,24 +155,6 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner
156155 this . isTransactionActive = false ;
157156 }
158157
159- private queryQueueMap = new Map < PoolClient , PromiseQueue < QueryArrayResult > > ( ) ;
160-
161- /**
162- * TODO Remove this method.
163- * This method is a workaround for a concurrency problem that occurs sometimes when using [email protected] . 164- */
165- private executeQuery ( connection : PoolClient , query : string , parameters : any [ ] ) {
166- if ( ! this . queryQueueMap . has ( connection ) ) {
167- const queue = new PromiseQueue < QueryArrayResult > ( ) ;
168- this . queryQueueMap . set ( connection , queue ) ;
169- queue . onEmpty ( ) . then ( ( ) => {
170- this . queryQueueMap . delete ( connection ) ;
171- } ) ;
172- }
173- const queue = this . queryQueueMap . get ( connection ) ;
174- return queue ! . add ( ( ) => connection . queryArray ( query , ...parameters ) ) ;
175- }
176-
177158 /**
178159 * Executes a given SQL query.
179160 */
@@ -191,8 +172,7 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner
191172 let error : any | undefined ;
192173 let result : QueryArrayResult | undefined ;
193174 try {
194- //result = await databaseConnection.query(query, ...(parameters || []));
195- result = await this . executeQuery ( databaseConnection , query , parameters || [ ] ) ;
175+ result = await databaseConnection . queryArray ( query , ...( parameters || [ ] ) ) ;
196176 } catch ( err ) {
197177 error = err ;
198178 }
0 commit comments