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

# Connect Your Data Warehouse

> Set up a secure connection between ClarityQ and your data warehouse.

The first step to using ClarityQ is connecting your data warehouse. ClarityQ uses **read-only access** to query your data — it never writes to or modifies your database.

## Supported Data Warehouses

<CardGroup cols={3}>
  <Card title="BigQuery" icon="google" href="/data-warehouse/bigquery">
    Google BigQuery
  </Card>

  <Card title="Snowflake" icon="snowflake" href="/data-warehouse/snowflake">
    Snowflake
  </Card>

  <Card title="Redshift" icon="aws" href="/data-warehouse/redshift">
    Amazon Redshift
  </Card>

  <Card title="PostgreSQL" icon="database" href="/data-warehouse/postgres">
    PostgreSQL
  </Card>

  <Card title="Databricks" icon="cube" href="/data-warehouse/databricks">
    Databricks
  </Card>

  <Card title="MaxCompute" icon="cloud" href="/data-warehouse/maxcompute">
    Alibaba Cloud MaxCompute
  </Card>
</CardGroup>

## Setup Process

1. **Select your data warehouse** — Choose from the supported platforms above based on your infrastructure.
2. **Configure credentials** — Follow the platform-specific guide to create a service account or user with read-only access.
3. **Connect in ClarityQ** — Enter your connection details in the setup wizard. ClarityQ will validate the connection automatically.
4. **Select tables** — Choose which tables and schemas ClarityQ should have access to.
5. **Define mandatory filters** *(optional)* — Set global filter conditions that apply to all selected tables.

<Tip>
  The setup wizard walks you through each step. Most connections take under 10 minutes to configure.
</Tip>

## Mandatory Filters

Mandatory filters let you define SQL WHERE conditions that are **automatically applied to every query** ClarityQ runs against your tables. They're useful for scoping your data — for example, restricting to a specific product, excluding deleted records, or filtering out stale data.

**Examples:**

```sql theme={null}
bundle_id = 'com.myapp'
```

```sql theme={null}
is_deleted = false AND created_at >= '2024-01-01'
```

### When to use them

* You have multi-tenant tables and want ClarityQ to only see data for your product
* You need to exclude test data, deleted records, or irrelevant rows
* You want to limit the date range ClarityQ queries to avoid scanning historical data you don't need

### How they work

* **Set during setup** — Step 5 of the setup wizard lets you define mandatory filters that apply to all newly added tables.
* **Edit per table** — After setup, you can adjust filters for individual tables from the Table Catalog's table settings.
* **Validated before saving** — ClarityQ runs a dry-run validation against your warehouse to make sure the filter syntax is correct.
* **Enforced automatically** — Every query ClarityQ generates for a filtered table includes these conditions in the WHERE clause. Users don't see or need to think about them.

<Warning>
  Mandatory filter changes made in the setup wizard apply only to **newly added tables**. Existing tables are not affected — edit their filters individually from the Table Catalog.
</Warning>

## What Every Connection Includes

* **Read-only access** — ClarityQ never writes to your database
* **Encrypted data transmission** via SSL/TLS
* **Authentication options** tailored to each platform (service accounts, IAM roles, dedicated users)
* **Connection pooling** for optimal performance
* **Troubleshooting steps** in each platform guide

## What Happens After You Connect

Once your data warehouse is connected, ClarityQ begins discovering your tables and schemas. This feeds into the [Table Catalog](/context-layer/table-catalog/what-is-the-table-catalog), the first building block of your Context Layer.
