> ## Documentation Index
> Fetch the complete documentation index at: https://basedash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# BigQuery

> Connect your BigQuery data warehouse to Basedash

Connect your Google BigQuery data warehouse to Basedash to analyze and visualize your enterprise data.

## Prerequisites

* A [Google Cloud project with BigQuery enabled](https://console.cloud.google.com/?src=Basedash)
* Service account with BigQuery access
* Service account key file (JSON)
* Relevant dataset permissions

## Connection setup

1. Open the **Data** page and click **Add data source**
2. Select **BigQuery**
3. Under **JSON key**, upload your service account key file. Basedash reads the project from the key.
4. Click **Connect**. Basedash checks the connection, then opens the new data source and starts syncing its schema.

![The BigQuery connection form in Basedash with a service account JSON key uploaded and instructions for creating the key in Google Cloud Console](https://mintcdn.com/basedash/1uWWcBDZtjMM1cxJ/images/data-sources/warehouses/bigquery/connection-form.webp?fit=max\&auto=format\&n=1uWWcBDZtjMM1cxJ\&q=85\&s=b72ffbf0cc87e8bd50d83c5fd2d80c11)

## Required permissions

Your service account needs the following IAM roles:

* `roles/bigquery.dataViewer` - to read data
* `roles/bigquery.jobUser` - to run queries
* `roles/bigquery.resourceViewer` - to list projects and datasets

## Best practices

* Create a dedicated service account for Basedash
* Grant minimum required permissions
* Regularly rotate service account keys
* Use table partitioning for large datasets
* Set appropriate query cost limits

## Performance optimization

* Use clustered and partitioned tables
* Materialize commonly used views
* Create appropriate table statistics
* Monitor query costs and performance
* Set up appropriate caching policies

## Troubleshooting

For what each connection error means and how to fix it, see [Connection settings](https://basedash.com/docs/data-sources/connection-settings.md#troubleshooting).

* Verify service account permissions
* Check if datasets are accessible
* Monitor query quotas and limits
* Review [BigQuery audit logs for errors](https://console.cloud.google.com/logs/query?src=Basedash)

## Next steps: Add custom context

You can add custom context to help the AI better understand your data structure and business logic. Consider adding context at the dataset or schema level if you notice the AI struggling to locate or understand specific data.

### Automatic metadata import

Basedash automatically imports table and column descriptions that are already set up in your BigQuery instance. If you have existing metadata in BigQuery, it will be available in Basedash without additional configuration.

### When to add context

* **Complex transformed data**: When the AI needs help understanding data transformation logic
* **Business-specific metrics**: If calculated fields or KPIs need additional explanation
* **Unclear naming conventions**: When table or column names don't clearly indicate their purpose

For detailed guidance, see our [custom context documentation](https://basedash.com/docs/features/ai-context.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.