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

# Connecting ClickHouse to Omni

> Learn how to retrieve connection details and connect your ClickHouse database to Omni.

export const BaseAccess = () => {
  return <span>
      <ParamField path="Base Access" required>
        Select the <a href="/administration/users/permissions">minimum level of access</a> users should have to models in the connection.
      </ParamField>
    </span>;
};

export const AllowUserSpecificTimezones = () => {
  return <span>
      <ParamField path="Allow User-Specific Timezones">
        When enabled, users can override the connection timezone with their own when querying.
      </ParamField>
    </span>;
};

export const QueryTimezone = () => {
  return <span>
      <ParamField path="Query Timezone" required>
        The timezone to use for Omni queries. If a timezone is specified, data will be converted from the <strong>Database Timezone</strong> to the selected timezone.
      </ParamField>
    </span>;
};

export const DatabaseTimezone = () => {
  return <span>
      <ParamField path="Database Timezone" required>
        The timezone used by the database.
      </ParamField>
    </span>;
};

export const TrustServerCertificate = () => {
  return <span>
      <ParamField path="Trust Server Certificate">
        Whether to trust the server's SSL/TLS certificate without validation.
      </ParamField>
    </span>;
};

export const Password = () => {
  return <span>
      <ParamField path="Password" required>
        The password for database authentication.
      </ParamField>
    </span>;
};

export const Username = () => {
  return <span>
      <ParamField path="Username" required>
        The username for database authentication.
      </ParamField>
    </span>;
};

export const TableUploads = ({label = "Schema for Table Uploads", term = "schema"}) => {
  return <span>
      <ParamField path={label}>
        The name of the {term} to use for table (CSV) uploads. If left blank, you can upload tables but they won't be pushed to the database or be available for use in joins.
      </ParamField>
    </span>;
};

export const Offloaded = ({term = "Schemas"}) => {
  const lower = term.toLowerCase();
  return <span>
      <ParamField path={`Offloaded ${term}`}>
        A comma-separated list of {lower} to include in the connection, which will only load on demand. This setting is good for large {lower} or dbt dev {lower}.
      </ParamField>
    </span>;
};

export const Include = ({term = "Schemas"}) => {
  const lower = term.toLowerCase();
  return <span>
      <ParamField path={`Include ${term}`}>
        A comma-separated list of {lower} to include in the connection.
      </ParamField>
    </span>;
};

export const Default = ({term = "Schema", required = true, defaultValue}) => {
  const lower = term.toLowerCase();
  return <span>
      <ParamField path={`Default ${term}`} required={required} default={defaultValue}>
        The default {lower} for the connection.
      </ParamField>
    </span>;
};

export const Port = ({defaultValue}) => {
  return <span>
      <ParamField path="Port" required default={defaultValue}>
        The port number for the database connection.
      </ParamField>
    </span>;
};

export const Host = () => {
  return <span>
      <ParamField path="Host" required>
        The address of the database server.
      </ParamField>
    </span>;
};

export const DisplayName = () => {
  return <span>
      <ParamField path="Display Name" required>
        A user-friendly name for the connection, which will be used throughout Omni.
      </ParamField>
    </span>;
};

## Requirements

To follow the steps in this guide, you'll need:

* **Organization Admin permissions in Omni**
* **Permissions in ClickHouse** that allow you to access connection credentials

## Setup

<Steps>
  <Step title="Retrieve ClickHouse connection details" titleSize="h3">
    1. In ClickHouse, navigate to the warehouse you want to connect to Omni.
    2. Click **Connect** in the side navigation.
    3. A dialog like the following will display:

           <img src="https://mintcdn.com/omni-e7402367/6E4-2rN1WROLPofK/connect-data/images/clickhouse-connection-details.png?fit=max&auto=format&n=6E4-2rN1WROLPofK&q=85&s=ac1fca84d73b539fc377757dde4470ee" alt="Connection details" width="1000" height="841" data-path="connect-data/images/clickhouse-connection-details.png" />

    The information you need is highlighted in the above image, specifically:

    * **Username** - In the above image, the username is ClickHouse's default (`default`), but this may differ for you.

          <Note>
            If you want to use a different (non-default) Clickhouse user, verify that the user has, at a minimum, `SELECT` permissions for:

            * All schemas you want to include in the Omni model
            * `INFORMATION_SCHEMA.SCHEMATA`
            * `INFORMATION_SCHEMA.TABLES`
          </Note>

    * **Password**

    * **Host** - This is a string similar to `https://<some-string>.eastus2.azure.clickhouse.cloud`

    * **Port** - In the above image, the port is `8443`

    Keep this information handy - you'll need it to complete the setup.
  </Step>

  <Step title="Allowlist Omni's IP addresses" titleSize="h3">
    If access to ClickHouse is [limited by IP address](https://clickhouse.com/docs/cloud/security/setting-ip-filters#create-or-modify-an-ip-access-list), you'll need to add Omni's IPs to the allowlist before you create the database connection.

    Omni's IP addresses can be found on an individual connection's page, accessed by navigating to **Settings > Connections** and clicking a connection.
  </Step>

  <Step title="Create the connection in Omni" titleSize="h3">
    1. In Omni, click **Settings > Connections**.

    2. Click the **ClickHouse** option.

    3. On the connection setup page, fill in the connection details:

           <DisplayName />

           <Host />

           <Port defaultValue="8443" />

           <Default />

           <Include />

           <Offloaded />

           <TableUploads />

           <Username />

           <Password />

           <TrustServerCertificate />

           <DatabaseTimezone />

           <QueryTimezone />

           <AllowUserSpecificTimezones />

           <BaseAccess />

    4. When finished, click **Create connection**.
  </Step>
</Steps>

## What's next?

Now that your database is set up, you can:

* Use the Omni Agent's [quickstart skill](/modeling/topics/quickstart) to create your first topic from business questions
* Configure user permissions, [schema refreshes](/modeling/develop/schema-refreshes), [environments](/connect-data/dynamic-environments) and [timezone settings](/connect-data/timezones)
* Learn how Omni [generates the model](/modeling/develop/model-generation) associated with the connection
