# Configuring Google BigQuery workspace data connections

During workspace creation, under **Connection Type**, click **BigQuery**.

## Connecting to the source database <a href="#bigquery-source-connection" id="bigquery-source-connection"></a>

In the **Source Settings** section, you provide the connection information for the source database:

1. In the **Project ID** field, provide the identifier of the project that contains the source database.
2. In the **Dataset Name** field, provide the name of the dataset that contains the source database.
3. For **Service Account File**, select the service account file (JSON file) for the source database.\
   \
   On a self-hosted instance, to instead use Application Default Credentials (ADC), click **Application Default Credentials**.
4. To test the connection to the source database, click **Test Source Connection**.

## Enabling de-identification of Google BigQuery views <a href="#bigquery-workspace-deidentify-views" id="bigquery-workspace-deidentify-views"></a>

By default, Tonic Structural copies views from the source database to the destination database. You do not assign generators to view data.

To enable de-identification of view data, toggle the **De-identify views** option to the on position.

You cannot de-identify views that are written in Google Legacy SQL.

When **De-identify views** is enabled:

* Structural includes views in the lists on **Privacy Hub**, **Database View**, and **Table View**.\
  \
  To identify an item as a view, the name is followed by **(view)**.\
  \
  Structural does not display views that are written in Google Legacy SQL.
* You can assign table modes to the views, and generators to the view columns.

When you run data generation:

1. Structural applies the table modes and generators to the view data.\
   \
   The data generation does not include views that are written in Google Legacy SQL.
2. For each view, Structural writes the de-identified data to a table called `<view name>_tonic_table`.
3. Structural also creates a view that has the same name and metadata as the view in the source data, but is populated from the destination table.

For example, for a source view called `customers`, in the destination database, Structural:

1. Uses the assigned table mode and generators to create a table called `customers_tonic_table`.
2. Creates a `customers` view that uses the schema and metadata from the source `customers` view, but is populated by the data from `customers_tonic_table`.

## Connecting to the destination database <a href="#bigquery-destination-connection" id="bigquery-destination-connection"></a>

Note that destination tables cannot be external tables. They must be native BigQuery tables.

In the **Destination Settings** section, you provide the connection information for the destination database:

1. In the **Project ID** field, provide the identifier of the project that contains the destination database.
2. In the **Dataset Name** field, provide the name of the dataset that contains the destination database.
3. For **Service Account File**, select the service account file (JSON file) for the destination database.\
   \
   On a self-hosted instance, to instead use Application Default Credentials (ADC), click **Application Default Credentials**.
4. To test the connection to the destination database, click **Test Destination Connection**.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/setting-up-your-database/google-bigquery/bigquery-workspace-data-connections.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
