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

# BigQuery

> Let the Dema Agent query data, explore schemas, and run SQL against Google BigQuery.

## Overview

Once BigQuery is connected, the Dema Agent can list datasets, inspect table schemas, and run SQL queries against your BigQuery project. Useful for pulling warehouse data into an analysis alongside Dema metrics.

***

## Prerequisites

* A Google Cloud project with BigQuery enabled.
* A Google account with at least `BigQuery User` or equivalent permissions on the datasets you want Dema to access.

***

## Connect BigQuery

1. In Dema, go to **Agents → Settings → Integrations**.
2. Find **BigQuery** and click **Connect**.
3. Sign in to Google and approve the scopes Dema requests.
4. You are returned to Dema with the integration marked as Active.

***

## Scopes Dema requests

| Scope                                      | What it allows                                                                |
| ------------------------------------------ | ----------------------------------------------------------------------------- |
| `https://www.googleapis.com/auth/bigquery` | Run queries, list datasets, and read table schemas in projects you can access |

***

## Troubleshooting

* **Query fails with permission denied.** Confirm your Google account has access to the dataset or table. BigQuery honors your existing IAM permissions, so Dema only sees what you already see.

***

## Additional resources

* [BigQuery access control](https://cloud.google.com/bigquery/docs/access-control)
