Skip to content

Commit cc54c04

Browse files
committed
feat(bigquery-driver): optimize testConnection() with free of charge request
1 parent 57072c8 commit cc54c04

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/cubejs-bigquery-driver/src/BigQueryDriver.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,13 @@ export class BigQueryDriver extends BaseDriver implements DriverInterface {
155155
}
156156

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

165167
public readOnly() {

0 commit comments

Comments
 (0)