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

# Google BigQuery

> Connect Mora to Google BigQuery using a service account.

## Prerequisites

* A Google Cloud project with BigQuery enabled.
* A service account with the **BigQuery Data Viewer** and **BigQuery Job User** roles (or equivalent).
* The service account's JSON key file.

## Required fields

| Field               | Description                                                                                               |
| ------------------- | --------------------------------------------------------------------------------------------------------- |
| **Name**            | A display name for this datasource.                                                                       |
| **Service account** | The full JSON key for your GCP service account. Paste the entire contents of the downloaded `.json` file. |

The JSON key looks like this:

```json theme={null}
{
  "type": "service_account",
  "project_id": "your-project",
  "private_key_id": "...",
  "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
  "client_email": "mora@your-project.iam.gserviceaccount.com",
  "client_id": "...",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "token_uri": "https://oauth2.googleapis.com/token",
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "client_x509_cert_url": "..."
}
```

## Steps

1. Open **Settings → Datasources → New**.
2. Enter a name and select **Google BigQuery** as the type.
3. Paste your service account JSON into the **Service account** field.
4. Click **Test connection** to verify.
5. Click **Create**.

## Creating a service account

If you don't have a service account yet:

1. Go to the [GCP Console → IAM & Admin → Service Accounts](https://console.cloud.google.com/iam-admin/serviceaccounts).
2. Click **Create Service Account**.
3. Give it a name (e.g. `mora-reader`) and click **Create and Continue**.
4. Grant the roles **BigQuery Data Viewer** and **BigQuery Job User**.
5. Click **Done**, then click into the new service account.
6. Go to the **Keys** tab, click **Add Key → Create new key**, select **JSON**, and download the file.
7. Paste the contents of that file into Mora.

## Related

* [Catalog sync](/datasources/catalog)
* [Managing datasources](/datasources/manage)
