Connecting to BigQuery

PopSQL allows two ways to connect to your BigQuery data warehouse: OAuth and Service Account.

OAuth

  1. Click Manage Connections in the top center of the app. alt text

  2. Click New Connection in the Manage Connections modal in PopSQL. alt text

  3. Create a Nickname for this connection (for your own internal reference).

  4. For Type, choose BigQuery.

  5. Select OAuth when asked how you want to connect to BigQuery.

  6. Click the Sign in with Google button. You will be taken to an external page hosted by Google for authentication. Note: the BigQuery Job User IAM role is required for whatever Google user you use. alt text

  7. Upon successful authentication, return to PopSQL.

  8. Enter the name 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.

  1. Visit the Credentials page in Google Cloud Console

  2. Select your project alt text

  3. Click Create credentials, and then Service account key alt text

  4. 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. alt text

  5. Download the .json file, open it in a text editor, and copy the entire file contents to your clipboard. alt text

  6. Open the PopSQL connections modal, click New Connection, name it, choose BigQuery as the type, select Service Account as connection type, paste your clipboard (the .json file contents) into the Service Account field, and hit Connect. alt text

  7. Once you're connected, try this sample query:

SELECT title FROM `bigquery-public-data.samples.wikipedia` LIMIT 5;

Happy querying! 🍭

Ready for a modern SQL editor?