Skip to content

Commit

Permalink
feat(bigquery-driver): optimize testConnection() with free of charge …
Browse files Browse the repository at this point in the history
…request (#8845)
  • Loading branch information
KSDaemon authored Oct 22, 2024
1 parent d1698ce commit 99ad335
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/cubejs-bigquery-driver/src/BigQueryDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ export class BigQueryDriver extends BaseDriver implements DriverInterface {
}

public async testConnection() {
await this.bigquery.query({
query: 'SELECT ? AS number',
params: ['1'],
jobTimeoutMs: this.testConnectionTimeout(),
});
// From the BigQuery Docs:
// You are not charged for list, get, patch, update and delete calls.
// Examples include (but are not limited to): listing datasets, updating
// a dataset's access control list, updating a table's description, or
// listing user-defined functions in a dataset.
// @see https://cloud.google.com/bigquery/pricing#free
await this.bigquery.getDatasets();
}

public readOnly() {
Expand Down

0 comments on commit 99ad335

Please sign in to comment.