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

# BigQuery

To specify a connection to BigQuery, you'll need to generate a service account
keyfile, then pass the path to that file to your `config.yml` file, as shown below:

```yaml theme={null}
# required fields
- name: bigquery_connection
  type: bigquery
  key_path: /path/to/key.json
  datasets:
    dataset_num_one:
      - "*" # all tables
    dataset_num_two:
      - "monthly_active_*" # regex filtered tables
    user_analytics:
      - "company_activity_analytics_summary_view" # one specific table
```

# Generating a keyfile

To generate a keyfile, follow these steps:

1. Sign into the [Google cloud console](https://console.cloud.google.com/).
2. Ensure that you have API enabled on the [BigQuery API page](https://console.cloud.google.com/apis/library/bigquery.googleapis.com).
3. On the [Service accounts](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts) page, choose your project and click the button that says "Create Service Account".
4. Choose a service account name and click "Create and continue".
5. Under "Select a role", choose "BigQuery" and choose an appropriate role for your service account. As this will only be used locally by you, we generally recommend using the most permissive role, **BigQuery Admin**. Complete the creation of your service account.
6. On the [Service accounts](https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts) page, select the service account you created and click on the ellipsis under the "Actions" column. Select **Manage keys**.
7. On this next page, click **Add key** > **Create new key**. Select JSON in the modal and click "Create". The key will be automatically downloaded in your browser.
