Skip to content

Commit

Permalink
feat(redshift-driver): optimize testConnection() with just establishi…
Browse files Browse the repository at this point in the history
…ng connection without real query (#8847)
  • Loading branch information
KSDaemon authored Oct 22, 2024
1 parent 99ad335 commit 3c20346
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions packages/cubejs-redshift-driver/src/RedshiftDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ export class RedshiftDriver extends PostgresDriver<RedshiftDriverConfiguration>
}
}

/**
* AWS Redshift doesn't have any special connection check.
* And querying even system tables is billed.
* @override
*/
public async testConnection() {
const conn = await this.pool.connect();
conn.release();
}

public override async stream(
query: string,
values: unknown[],
Expand Down Expand Up @@ -287,8 +297,7 @@ export class RedshiftDriver extends PostgresDriver<RedshiftDriverConfiguration>
};
} finally {
conn.removeAllListeners('notice');

await conn.release();
conn.release();
}
}

Expand Down

0 comments on commit 3c20346

Please sign in to comment.