Google BigQuery Setup
This guide walks you through connecting Datoria to Google BigQuery and setting up your first data project.
Prerequisites
Before you begin, make sure you have:
- Google Cloud Project
- A Google Cloud project with billing enabled
- BigQuery API enabled (Enable in Cloud Console)
- Authentication
- Google Cloud CLI (gcloud) installed
- Authenticated with appropriate permissions
- Datoria
- Datoria CLI installed (see Setup Datoria Core)
- Editor extension installed (see Setup Datoria Core)
Authentication
Datoria works with Google Cloud's standard authentication methods. For development, we recommend using application default credentials:
gcloud auth application-default login
This will open a browser window where you can log in with your Google account. After authenticating, Datoria will use these credentials when accessing BigQuery.
Alternative Authentication Methods
For production or CI/CD environments, use a service account:
# Set the path to your service account key file
export GOOGLE_APPLICATION_CREDENTIALS="/path/to/your-service-account-key.json"
Learn more about creating service accounts.
Required Permissions
For Datoria to function properly with BigQuery, it needs sufficient permissions to create and manage database objects. The simplest approach is to use the BigQuery Admin role:
- Using gcloud CLI
- Using Cloud Console
# For user accounts
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member=user:YOUR_EMAIL@example.com \
--role=roles/bigquery.admin
# For service accounts
gcloud projects add-iam-policy-binding YOUR_PROJECT_ID \
--member=serviceAccount:YOUR_SERVICE_ACCOUNT@YOUR_PROJECT_ID.iam.gserviceaccount.com \
--role=roles/bigquery.admin
- Go to the IAM & Admin page in the Google Cloud Console
- Ensure your project is selected in the dropdown at the top of the page
- Click the +Grant Access button
- In the "New principals" field, enter the email address or service account
- In the "Select a role" dropdown, search for and select "BigQuery Admin"
- Click Save
The BigQuery Admin role provides comprehensive access to manage all BigQuery resources, including:
- Creating and managing datasets
- Creating, updating, and deleting tables
- Running queries and jobs
- Creating and managing routines (UDFs, stored procedures)
- Managing data access policies