> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/setting-up-your-database/google-bigquery/bigquery-workspace-data-connections.md).

# Configuring Google BigQuery workspace data connections

During workspace creation, from the **Connection Type** dropdown list, select **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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
