Connecting to BigQuery
PopSQL allows two ways to connect to your BigQuery data warehouse: OAuth and Service Account.
OAuth
Click
Manage Connections
in the top center of the app.Click
New Connection
in theManage Connections
modal in PopSQL.Create a
Nickname
for this connection (for your own internal reference).For
Type
, choose BigQuery.Select
OAuth
when asked how you want to connect to BigQuery.Click the
Sign in with Google
button. You will be taken to an external page hosted by Google for authentication. Note: theBigQuery Job User
IAM role is required for whatever Google user you use.Upon successful authentication, return to PopSQL.
Enter the Project ID of your desired
BigQuery Project
.
Service Account
You'll need to be an owner in your Google Cloud project to create a service account. If you're not, please contact the administrator of your BigQuery database.
Visit the Credentials page in Google Cloud Console
Select your project
Click
Create credentials
, and thenService account key
Click
New service account
, name it (ie "PopSQL BigQuery" or your full name), give it the BigQuery Admin role, select JSON, and hit the Create button.Download the .json file, open it in a text editor, and copy the entire file contents to your clipboard.
Open the PopSQL connections modal, click
New Connection
, name it, choose BigQuery as the type, selectService Account
as connection type, paste your clipboard (the .json file contents) into the Service Account field, and hit Connect.Once you're connected, try this sample query:
SELECT title FROM `bigquery-public-data.samples.wikipedia` LIMIT 5;
Happy querying! 🍭
Spread the word
Tweet