Skip to content

Commit

Permalink
fixed connect logic for current version by calling acquire
Browse files Browse the repository at this point in the history
  • Loading branch information
pj-spoelders committed Oct 23, 2024
1 parent 8a7f6c7 commit bc9eefc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/sql-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ export class ExasolDriver implements IExasolDriver {
* @inheritDoc
*/
public async connect(): Promise<void> {
await this.acquire();
}
private async createConnectionAndAddToPool(): Promise<void> {
let hasCredentials = false;
let isBasicAuth = false;
if (this.config.user && this.config.password) {
Expand Down Expand Up @@ -418,7 +421,7 @@ export class ExasolDriver implements IExasolDriver {
} else {
//create a new connection if the pool is not at max size, add it to the pool and then acquire it.
this.logger.debug('[SQLClient] Found no free connection and pool did not reach its limit, will create new connection');
await this.connect();
await this.createConnectionAndAddToPool();
connection = this.pool.acquire();
}
if (!connection) {
Expand Down

0 comments on commit bc9eefc

Please sign in to comment.