go-gorm / bigquery

BigQuery golang sql driver/GORM dialect
MIT License
42 stars 23 forks source link

Add scopes option support #10

Closed nroman197 closed 2 years ago

nroman197 commented 2 years ago

What did this pull request do?

User Case Description

Background: In order to implement an extractor that uses the Gorm BigQuery driver, we require the use of scopes to get data from a view that is being populated by a Google Sheet.

Feature: Being able to authenticate the bigquery client by passing OAuth2 scopes received in the uri.

Some examples of valid connection strings:

"bigquery://project-id/location/dataset?scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/bigquery"

"bigquery://bigquery-credits/dataset?scopes=https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/bigquery"

"bigquery://bigquery-credits/location/dataset"

"bigquery://bigquery-credits/dataset"