Skip to content

Commit

Permalink
fixing api options
Browse files Browse the repository at this point in the history
hafenkran committed Sep 18, 2024
1 parent 8fe8475 commit 1ad3400
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bigquery_client.cpp
Original file line number Diff line number Diff line change
@@ -210,7 +210,7 @@ BigqueryTableRef BigqueryClient::GetTable(const string &dataset_id, const string

bool BigqueryClient::DatasetExists(const string &dataset_id) {
auto client = google::cloud::bigquerycontrol_v2::DatasetServiceClient(
google::cloud::bigquerycontrol_v2::MakeDatasetServiceConnectionRest(google::cloud::Options{}));
google::cloud::bigquerycontrol_v2::MakeDatasetServiceConnectionRest(OptionsAPI()));

auto request = google::cloud::bigquery::v2::GetDatasetRequest();
request.set_project_id(config.project_id);
@@ -226,7 +226,7 @@ bool BigqueryClient::DatasetExists(const string &dataset_id) {

bool BigqueryClient::TableExists(const string &dataset_id, const string &table_id) {
auto client = google::cloud::bigquerycontrol_v2::TableServiceClient(
google::cloud::bigquerycontrol_v2::MakeTableServiceConnectionRest(google::cloud::Options{}));
google::cloud::bigquerycontrol_v2::MakeTableServiceConnectionRest(OptionsAPI()));

auto request = google::cloud::bigquery::v2::GetTableRequest();
request.set_project_id(config.project_id);
@@ -427,7 +427,7 @@ google::cloud::StatusOr<google::cloud::bigquery::v2::Job> BigqueryClient::GetJob
}

auto client = google::cloud::bigquerycontrol_v2::JobServiceClient(
google::cloud::bigquerycontrol_v2::MakeJobServiceConnectionRest(google::cloud::Options{}));
google::cloud::bigquerycontrol_v2::MakeJobServiceConnectionRest(OptionsAPI()));

auto request = google::cloud::bigquery::v2::GetJobRequest();
request.set_project_id(config.project_id);
9 changes: 9 additions & 0 deletions test/sql/local/attach_read_only.test
Original file line number Diff line number Diff line change
@@ -11,6 +11,15 @@ require-env BQ_GRPC_ENDPOINT
statement ok
ATTACH 'project=test api_endpoint=${BQ_API_ENDPOINT} grpc_endpoint=${BQ_GRPC_ENDPOINT}' AS bq (TYPE bigquery);

statement ok
DROP TABLE IF EXISTS bq.dataset1.read_only;

statement ok
DETACH DATABASE IF EXISTS bq;

statement ok
ATTACH 'project=test api_endpoint=${BQ_API_ENDPOINT} grpc_endpoint=${BQ_GRPC_ENDPOINT}' AS bq (TYPE bigquery, READ_ONLY);

statement error
CREATE TABLE bq.dataset1.read_only(i INTEGER);
----

0 comments on commit 1ad3400

Please sign in to comment.