BigQuery
Requirements
To connect DataChat to your BigQuery project, you’ll need:
- Project name
- Dataset name
- Key file (for service accounts)
Permissions
To connect to BigQuery, your account must have the following permissions:
BigQuery Data Viewer
. Grants read access to specific tables or views.BigQuery Job User
. Grants permission to run jobs at the dataset level.
If you plan to use BigQuery ML, ensure the account has the following permissions:
bigquery.jobs.create
bigquery.models.create
bigquery.models.getData
bigquery.models.updateData
bigquery.models.updateMetadata
bigquery.models.delete
For more information on BigQuery ML permissions, see Google Cloud's documentation.
Connection Methods
OAuth
Refer to Enable Database OAuth for more information.
Service Accounts
If you're using a service account to connect to BigQuery, follow these steps before connecting in DataChat:
Create a service account
- In the Google Cloud Console, go to IAM & Admin > Service Accounts.
- Click Create Service Account.
- Enter a name (e.g., datachat-access) and click Create.
- Ensure the service account has the necessary permissions.
Download the Key File
- In the Service Accounts list, click the name of your new account.
- Go to the Keys tab, then click Add Key > Create new key.
- Select JSON and click Create. The file will download automatically. Keep this file secure as it won’t be downloadable again.
Add Your BigQuery Database
To add your BigQuery database:
- Give the database a display name. This is how you'll reference the database across DataChat.
- In the Project field, enter the name of your BigQuery project.
- In the Dataset Name field, enter the name of your BigQuery dataset.
- Select whether this connection will use a service account or connect to BigQuery via OAuth.
- If this connection uses a service account, upload your key file.
- Optionally, set the database to be read-only.
- Optionally, enable using BigQuery's storage API. Note that selecting this option can improve performance when interacting with your BigQuery tables, but may result in increased BigQuery costs.
- Test your database, then click Save.