BigQuery Connection Help

RazorSQL provides support for connecting to Google BigQuery databases. See the below for information on how to get connected.

First, after launching RazorSQL, select the Connections -> Add Connection Profile menu option. Then, select "BigQuery (Google)" as the connection type and click Continue.

On the next page, on the left-hand side of the screen, there is a "Connection Type" list. The first entry in this list is the "JDBC (Simba BigQuery JDBC Driver)" option. This is the preferred method for connecting to BigQuery. This driver does not ship with RazorSQL, but RazorSQL can download and configure the driver. To have RazorSQL do this, click the "Auto-Download Driver" button that is displayed on the RazorSQL connection screen.

After having RazorSQL download the BigQuery JDBC driver, enter a profile name for your connection. Then, determine how you would like to authenticate to the BigQuery database. Authentication can be achieved in one of three ways:

Google Serivce Account Authentication: To authenticate to BigQuery using Google Service Account credentials, enter the Google Service Account email and enter the location of the Google Service Account private key file. If you do not have a google service account email and private key file, you can create one using the Google API console. The following link should take you to Google's service accounts page:

https://console.developers.google.com/permissions/serviceaccounts

The creation process will generate a Google Service Account email id to be used for the authentication id, and it will generate a private key file that will be stored on your machine. RazorSQL needs to know the email id and location of the private key file to authenticate to BigQuery using the service account authentication option. Examples of a Google Service Account email and private key file are the following:

Service Account Email: exampleacct@bigqueryproject-201618.iam.gserviceaccount.com
Private Key File Path: C:\Users\johndoe\Desktop\bigqueryproject-abcde.json

Google User Account Authentication: For this type of authentication, you do not need to provide any credentials. After all the necessary information in entered such as the host and BigQuery project name, click Connect. A dialog window will appear with a web URL. Copy and paste this URL into your web browser. Follow the prompts in the browser to obtain an access token. Copy and paste the access token into the same dialog window that contained the web URL. Using this method will authenticate to the BigQuery database with the Google Service Account you used to login with via the browser.

Google App Default Credential Authentication: The Google App Default authentication option looks for a Google credentials file on the local machine. To find the credentials file, the following environment variable must be set to the location of the Google credentials file:

GOOGLE_APPLICATION_CREDENTIALS

Note: If setting the environment variable for the first time, the local machine may need to be restarted for the environment variable to be viewable by applications such as RazorSQL.

After selecting the authentication type, the following information needs to be provided so that RazorSQL can connect to the BigQuery database:

Host or IP Address: By default this is https://www.googleapis.com/bigquery/v2

Port: By default this is 443

Product Id: This is the BigQuery project id. Note that this is not the project name. Typically the project id has the following format: ProjectName-id. For example, BigQueryProject-201517