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

> ## Agent Instructions
> Orion is a collaborative analytics platform built by Gravity (bygravity.com). It connects to data warehouses like Snowflake, BigQuery, Databricks, Redshift, Athena, Fabric, PostgreSQL, and MySQL, and lets teams ask questions in natural language to get shared analyses, dashboards, reports, and slide decks. When referencing Orion features, always link to the relevant documentation page. Orion is not open-source; it is a commercial SaaS product accessed at runorion.com.

# Connecting Data Sources

> Step-by-step guides for connecting Orion to BigQuery, Snowflake, Databricks, Redshift, Athena, Fabric, PostgreSQL, MySQL, Delta Lake, Looker, and dbt — including credentials, grants, and network requirements.

These guides walk through what Orion needs to connect to each supported data source, and how to grant that access. Most connections are configured once at the tenant level by an administrator.

Every guide ends the same way: take the connection details you produced and enter them in Orion under **Configuration → Data Sources → Add Data Source**. See [Data Sources Management](/configuration/data-sources) for a tour of that page. If you'd rather not enter them yourself, share the details with your Gravity contact and we'll configure the connection for you.

## How Orion connects

A few principles apply to every connection:

<CardGroup cols={3}>
  <Card title="Read-only" icon="lock">
    Orion only ever issues read queries (`SELECT` and metadata introspection).
    It never runs DDL, DML, or stored procedures against your systems.
  </Card>

  <Card title="Least privilege" icon="user-shield">
    We recommend a dedicated service user or service account scoped to just the
    data you want Orion to analyze.
  </Card>

  <Card title="Encrypted at rest" icon="shield-halved">
    Any credentials you share (passwords, keys, secrets) are encrypted at rest
    in our database.
  </Card>
</CardGroup>

<Note>
  For private databases that aren't publicly reachable (behind a VPC, private
  subnet, firewall, or VPN), allowlist Orion's egress IPs so we can reach them.
  All Orion services egress through the same set of IPs, so a single allowlist
  entry covers everything. Your production egress IP range is provided by your
  Gravity contact during onboarding.
</Note>

## Choose your data source

<Columns cols={3}>
  <Card title="BigQuery" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/bigquery.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=a46b130617ab58d053c6732bab5a4deb" href="#bigquery" width="24" height="24" data-path="images/data-sources/bigquery.svg" />

  <Card title="Snowflake" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/snowflake.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=cf2ea2fe9a8ad7b968b9cb88108e06f9" href="#snowflake" width="24" height="24" data-path="images/data-sources/snowflake.svg" />

  <Card title="Databricks" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/databricks.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=1464760ad614bd996e279e2e3de62ae7" href="#databricks" width="24" height="24" data-path="images/data-sources/databricks.svg" />

  <Card title="Looker" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/looker.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=77236b3032f004e2403d65451a1b14ba" href="#looker" width="24" height="24" data-path="images/data-sources/looker.svg" />

  <Card title="PostgreSQL" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/postgres.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=95a4f3a47c74de4f850f93f7e2ec46ba" href="#postgresql" width="24" height="24" data-path="images/data-sources/postgres.svg" />

  <Card title="MySQL" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/mysql.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=c5a353caacfcc084c24a59f358423d8d" href="#mysql" width="24" height="24" data-path="images/data-sources/mysql.svg" />

  <Card title="Redshift" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/redshift.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=c2fbf2dbe511ebdf2ff0ddec252cd0b2" href="#redshift" width="64" height="64" data-path="images/data-sources/redshift.svg" />

  <Card title="Amazon Athena" icon="https://mintcdn.com/gravity-8db392ea/pLLrwA8MRRp1stmY/images/data-sources/athena.svg?fit=max&auto=format&n=pLLrwA8MRRp1stmY&q=85&s=1340d33b1ac502938da4fd16b04ebd2a" href="#amazon-athena" width="80" height="80" data-path="images/data-sources/athena.svg" />

  <Card title="Microsoft Fabric" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/fabric.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=e8751cbb6588dd65821cd91c66825760" href="#microsoft-fabric" width="64" height="64" data-path="images/data-sources/fabric.svg" />

  <Card title="Delta Lake" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/deltalake.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=0d2081251162906da69305569bad1391" href="#delta-lake" width="64" height="64" data-path="images/data-sources/deltalake.svg" />

  <Card title="dbt" icon="https://mintcdn.com/gravity-8db392ea/rwMJmY8tXTWfxg-1/images/data-sources/dbt.svg?fit=max&auto=format&n=rwMJmY8tXTWfxg-1&q=85&s=40da0de6b9b9d3f9c50371ff16c4bff7" href="#dbt" width="106" height="90" data-path="images/data-sources/dbt.svg" />
</Columns>

<Note>
  Setup guides for **Shopify** and **Google Analytics** are coming soon. In the
  meantime, your Gravity contact can provide documentation for connecting these
  sources.
</Note>

***

## BigQuery

Orion connects to BigQuery using **service account impersonation**. You create a service account in your project and grant Orion's service account permission to impersonate it. No credentials or keys are ever shared.

<Note>
  For every Google Cloud Console step below, make sure you are in the correct
  GCP project. Most setups use a single project for both the service account and
  the source data. If your datasets live in a different project from the one
  that runs Orion's queries, see [Querying datasets in another
  project](#querying-datasets-in-another-project).
</Note>

<Steps>
  <Step title="Create a service account">
    1. Go to **Google Cloud Console → IAM & Admin → Service Accounts**
    2. Click **Create Service Account**
    3. **Name:** `external-orion-data-access` (or your preferred naming)
    4. **Description:** "Service account for Orion data access"
    5. Click **Create and Continue**
    6. Skip role assignment for now → click **Done**

    We'll refer to this as the **BigQuery Service Account** going forward.
  </Step>

  <Step title="Enable service account impersonation">
    Before this step, the Orion team will provide you with a service account email address (the **Orion Service Account**) associated with your Orion instance.

    1. Navigate to **IAM & Admin → Service Accounts**
    2. Find the BigQuery Service Account you just created
    3. Select the **Principals With Access** tab and click **Grant Access**
    4. **Add principal:** the Orion Service Account email you received from Orion
    5. **Assign role:** **Service Account Token Creator**
    6. Click **Save**
  </Step>

  <Step title="Create a scratch dataset and grant edit access">
    1. Navigate to **BigQuery**
    2. Create a new dataset, a dedicated dataset reserved for Orion's use (we recommend a descriptive name like `orion_scratch`)
    3. Grant the BigQuery Service Account **Data Editor** access to this dataset

    <Warning>
      The scratch dataset **must be in the same region** (or multi-region) as the
      datasets you wish to query via Orion.
    </Warning>

    Orion uses this dataset to efficiently stream query results to a binary format optimized for quick analysis. Temp tables created here are automatically cleaned up.
  </Step>

  <Step title="Grant table-level access">
    In **BigQuery**, for each dataset or table you want to share:

    1. Select the dataset → click **Share Dataset**
    2. Add the BigQuery Service Account email
    3. **Assign role:** **BigQuery Data Viewer**
    4. Click **Add**, then **Done**
  </Step>

  <Step title="Grant project-level access">
    1. Navigate to **IAM**
    2. Locate your BigQuery Service Account and click **Edit**
    3. Assign the roles: **BigQuery Job User**, **BigQuery Connection User**, and **BigQuery Read Session User**
    4. Click **Save**
  </Step>

  <Step title="Enter the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **BigQuery**. The form asks for exactly what the steps above produced:

    | Field                            | From                                                                                                                              |
    | -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
    | **Project ID**                   | The GCP project that runs Orion's queries: where the service account, scratch dataset, and query jobs live                        |
    | **Service Account Email**        | The BigQuery Service Account from step 1                                                                                          |
    | **Scratch Dataset**              | The dataset from step 3                                                                                                           |
    | **Data Project ID** *(optional)* | The GCP project where your source datasets live, if it differs from **Project ID**. Leave blank when everything is in one project |
    | **Location**                     | The GCP location of your datasets (defaults to the `US` multi-region)                                                             |

    <img src="https://mintcdn.com/gravity-8db392ea/78erJbwdyaEmpWgN/images/data-sources/bigquery-connection-form.webp?fit=max&auto=format&n=78erJbwdyaEmpWgN&q=85&s=2ae7d7afbcfc566ced7309e3db982f33" alt="The Configure BigQuery Connection form in Orion" width="1440" height="1100" data-path="images/data-sources/bigquery-connection-form.webp" />

    No credentials need to be shared.

    <Note>
      **One project or two?** Most customers keep the service account, scratch
      dataset, and source data in a single project and leave **Data Project ID**
      blank. Fill it in only when your datasets live in a different project from
      the one running Orion's queries. See [Querying datasets in another
      project](#querying-datasets-in-another-project).
    </Note>
  </Step>
</Steps>

### Querying datasets in another project

Orion separates the project that **runs** your queries from the project that **stores** your data. The two roles map to the two form fields:

* **Project ID** is the compute and billing project. The service account, the scratch dataset, and every query job live here. Grant **BigQuery Job User**, **BigQuery Connection User**, and **BigQuery Read Session User** on this project (step 5), plus **Data Editor** on the scratch dataset (step 3).
* **Data Project ID** is where your source datasets live. Grant the service account **BigQuery Data Viewer** on those datasets (step 4).

When both are the same project, leave **Data Project ID** blank and Orion uses **Project ID** for everything. When your data lives elsewhere, set **Data Project ID** to that project. Orion then qualifies your tables against it while still running jobs and writing scratch results in **Project ID**. The service account still only needs impersonation set up once, in the project where it was created.

### Per-user OAuth (optional)

By default, Orion queries BigQuery through the shared service account above. With **per-user OAuth**, Orion instead runs each person's BigQuery queries under their own Google identity, so what each user can see in Orion follows the BigQuery permissions they already have, rather than a single shared service account.

<Note>
  Per-user OAuth builds on the service account setup above, so complete that
  first. The service account is still used for unattended work such as scheduled
  refreshes with no individual owner and schema introspection.
</Note>

Use it when you want each person's data access in Orion to match their existing BigQuery roles.

<Steps>
  <Step title="Create an OAuth client in Google Cloud">
    1. In **APIs & Services → OAuth consent screen**, set the **User type** to **Internal** so only your Google Workspace users can sign in
    2. In **APIs & Services → Credentials**, click **Create Credentials → OAuth client ID**
    3. **Application type:** Web application
    4. Add the **Authorized redirect URI** provided by your Gravity contact. It points at Orion's OAuth callback, for example `https://g.runorion.com/datasource/bq-oauth/callback`
    5. Click **Create**, then copy the **Client ID** and **Client Secret**
  </Step>

  <Step title="Enter the OAuth client in Orion">
    On the BigQuery data source (**Configuration → Data Sources**), open the **Connection** tab, click **Edit**, and set:

    | Field                      | Value                                               |
    | -------------------------- | --------------------------------------------------- |
    | **Authentication Mode**    | Per-user OAuth                                      |
    | **OAuth Client Reference** | A short name for this client (e.g. `acme-bigquery`) |
    | **OAuth Client ID**        | From the previous step                              |
    | **OAuth Client Secret**    | From the previous step                              |

    Save. The client ID and secret are sent to Orion's gateway and stored encrypted; they are never written to Orion's database. To rotate the secret later, enter the new values and save again. Leave them blank to keep the current ones.
  </Step>

  <Step title="Each user connects their Google account">
    The first time someone opens a project that uses this data source, Orion prompts them to connect. They click **Connect BigQuery**, sign in with Google, and consent once. From then on their queries run under their own identity.

    <Warning>
      Each person must sign in with the Google account whose email matches their
      Orion sign-in. If your team signs in to Orion with Google (SSO), this
      matches automatically.
    </Warning>
  </Step>
</Steps>

A couple of things to know:

* **Scheduled work runs as its creator.** A metric or workflow that someone schedules runs under that person's connected account. Work with no individual owner uses the service account.
* **If a user disconnects or loses BigQuery access**, their scheduled work pauses until they reconnect. This is deliberate: Orion never falls back to broader access than the user has.

[↑ Back to all data sources](#choose-your-data-source)

***

## Snowflake

Orion connects to Snowflake using **key pair authentication**. You create a dedicated service user, grant it read-only access to the data you want analyzed, and associate a public key with it. Orion holds the matching private key to authenticate.

**Connection information**

| Field                                           | Description                                                                                                                                                                          |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Account**                                     | Your Snowflake [account identifier](https://docs.snowflake.com/en/user-guide/admin-account-identifier) (e.g. `orgname-account_name` → `orgname-account_name.snowflakecomputing.com`) |
| **User / Role / Warehouse / Database / Schema** | Standard [connection context](https://docs.snowflake.com/en/user-guide/gen-conn-config) values used by Snowflake clients and drivers                                                 |

**Required grants** (on the role you configure for the connection)

```sql theme={null}
GRANT USAGE ON WAREHOUSE <w> TO ROLE <r>;
GRANT USAGE ON DATABASE <db> TO ROLE <r>;
GRANT USAGE ON SCHEMA <db>.<schema> TO ROLE <r>;
GRANT SELECT ON ALL TABLES IN SCHEMA <db>.<schema> TO ROLE <r>;
```

**Key pair authentication setup**

<Steps>
  <Step title="Generate an encrypted key pair">
    Generate an encrypted private-public key pair (RSA 2048 or 3072 recommended).

    ```bash theme={null}
    # Encrypted private key (an optional passphrase is recommended)
    openssl genrsa 2048 | openssl pkcs8 -topk8 -v2 des3 -inform PEM -out rsa_key.p8
    # Associated public key
    openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub
    ```

    The private key stays on your system. The public key (`rsa_key.pub`) is added to the Snowflake user.
  </Step>

  <Step title="Create (or reuse) a service user">
    ```sql theme={null}
    CREATE USER orion_svc
      DEFAULT_ROLE = <r>
      MUST_CHANGE_PASSWORD = FALSE;
    ```

    Assign the relevant role with the grants listed above.
  </Step>

  <Step title="Associate the public key with the service user">
    ```sql theme={null}
    ALTER USER orion_svc SET RSA_PUBLIC_KEY='<contents of rsa_key.pub>';
    ```
  </Step>

  <Step title="Enter the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **Snowflake**. Enter the connection information from the table above (account, user, warehouse, role; database and schema are optional) and upload the **private key** file. Provide the passphrase if the key is encrypted.
  </Step>
</Steps>

**What we store:** Orion uses the private key to authenticate connections. We store the encrypted key and passphrases in our database, and we encrypt your encrypted key. See the [Snowflake key pair documentation](https://docs.snowflake.com/en/user-guide/key-pair-auth).

[↑ Back to all data sources](#choose-your-data-source)

***

## Databricks

Orion connects to Databricks using a dedicated **Service Principal** and a **SQL Warehouse** for compute. We strongly recommend OAuth M2M authentication.

<Steps>
  <Step title="Create a Service Principal">
    We recommend a dedicated Service Principal for Orion. Follow the [official documentation](https://docs.databricks.com/en/admin/users-groups/service-principals.html) to create one.
  </Step>

  <Step title="Create credentials">
    <CardGroup cols={2}>
      <Card title="OAuth M2M (recommended)" icon="key">
        Follow the [official documentation](https://docs.databricks.com/en/dev-tools/auth/oauth-m2m.html)
        to create a **Client ID** and **Client Secret**. Copy the Client Secret
        immediately; you only get one chance to see it.
      </Card>

      <Card title="Personal Access Token (legacy)" icon="clock-rotate-left">
        Follow the [official documentation](https://docs.databricks.com/en/dev-tools/auth/pat.html).
        PATs are legacy and being phased out by Databricks, so prefer OAuth M2M.
      </Card>
    </CardGroup>
  </Step>

  <Step title="Create or identify a SQL Warehouse">
    SQL Warehouses are the compute resources used to execute queries. Either identify an existing warehouse, or create a dedicated one following the [official documentation](https://docs.databricks.com/en/compute/sql-warehouse/create.html). Make note of the warehouse's **HTTP Path**.
  </Step>

  <Step title="Grant access">
    Grant the Service Principal **read access** to all catalogs, schemas, and tables you want Orion to analyze, plus access to the **SQL Warehouse** used to execute queries.
  </Step>

  <Step title="Configure the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **Databricks**. Give the connection a name and optional description, then fill in:

    | Field                             | Description                                | Example                        |
    | --------------------------------- | ------------------------------------------ | ------------------------------ |
    | **Host**                          | The host URL for your Databricks           | `abc-123.cloud.databricks.com` |
    | **Warehouse HTTP Path**           | The HTTP path to your chosen SQL Warehouse | `/sql/1.0/warehouses/abc123`   |
    | **Client ID** & **Client Secret** | OAuth M2M credentials                      |                                |

    <Tip>
      Optionally include a **Databricks Catalog** to limit the scope of data a
      given connection can access.
    </Tip>
  </Step>
</Steps>

[↑ Back to all data sources](#choose-your-data-source)

***

## Looker

Orion connects to Looker using a dedicated user account with analyst-level (read-only) permissions plus API credentials. You'll also grant the account access to the Spaces (folders) that hold your dashboards and Looks.

**Standard deployment:** We request a Looker account for the email **`orion@gravity.foundation`**, with permissions matching those of a typical analyst at your organization. Orion only needs **read** access.

**Required permissions** (in addition to analyst-level access)

* **Models** ([docs](https://cloud.google.com/looker/docs/admin-panel-users-roles)): can be scoped to necessary models via model sets; includes the `explore` permission
* **`see_system_activity`**, **`see_lookml`**, **`see_sql`**
* **`see_user_dashboards`** (or provide PDFs of sample dashboards instead)
* **`create_custom_fields`**: enables building custom fields via **+ Add**
* **`login_special_email`**: only if using non-email (third-party) authentication

**Content access (Spaces / folders)**

Model permissions and content access are configured separately in Looker. The Orion user also needs **view access** to the Spaces where your dashboards and Looks are stored:

<Steps>
  <Step title="Open the folder">
    Navigate to the folder(s) containing your key dashboards.
  </Step>

  <Step title="Manage access">Click **Manage Access** on the folder.</Step>

  <Step title="Add the Orion user">
    Add the Orion user (or a group it belongs to) with **View** access.
  </Step>
</Steps>

<Warning>
  Without this step, the Orion user will have model and query permissions but
  won't be able to see any saved dashboard content. See [Managing access to
  folders](https://cloud.google.com/looker/docs/managing-spaces-and-folders).
</Warning>

**API credentials:** Generate API keys for `orion@gravity.foundation` ([docs](https://cloud.google.com/looker/docs/api-auth)). Then, in Orion, go to **Configuration → Data Sources**, click **Add Data Source**, choose **Looker**, and enter your Looker **base URL**, the **`client_id`**, and the **`client_secret`**.

**Third-party authentication:** If you use Okta or another third-party provider, add the **`login_special_email`** permission. Navigate to the **Roles** section of the Admin panel (`https://[organization].cloud.looker.com/admin/roles`) and, if you don't already have external users, create a new permission set. See the [Looker documentation](https://cloud.google.com/looker/docs/admin-panel-users-roles#login_special_email).

### LookML augmentation (optional)

Beyond querying dashboards and Looks, Orion can read your LookML business logic directly from its GitHub repository, reusing the dimensions, measures, and joins you have already defined to write better SQL. Setup takes about 10 minutes and needs a GitHub repository admin for one step.

<Note>
  The GitHub account that owns the token you create must have **Read** access to
  the LookML repository (see Step 9). A valid token from an account without repo
  access fails with a "repository not found" error. If you are not a repo admin,
  loop one in for Step 9.
</Note>

<Steps>
  <Step title="Open the Looker datasource">
    On the **Configuration → Data Sources** page, open the Looker datasource and select the **Augmentation** tab.

    <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-tab.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=67182d35a39390dc22405d4ee5f8897c" alt="The Coffee Rush Looker datasource in Orion Configuration, with the Connection, Refresh Data, Augmentation, Schema, and Migration tabs" width="2688" height="1794" data-path="images/data-sources/lookml-augmentation-tab.webp" />
  </Step>

  <Step title="Start token creation">
    Click the **Create token** link to open GitHub.

    <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-create-token.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=a7e3db40d1d9eb39e49b4ce586620678" alt="The Create token link beneath the Personal Access Token field on the Augmentation tab" width="3428" height="1822" data-path="images/data-sources/lookml-augmentation-create-token.webp" />
  </Step>

  <Step title="Create a fine-grained PAT">
    On GitHub, begin creating a **fine-grained personal access token**.

    <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-pat-list.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=296e725cded09ea883ec71771abee17c" alt="GitHub's fine-grained personal access tokens page with the Generate new token button" width="3452" height="868" data-path="images/data-sources/lookml-augmentation-pat-list.webp" />
  </Step>

  <Step title="Set the resource owner and expiration">
    * **Resource owner:** select the organization or account where the Looker GitHub repository lives.
    * **Expiration (TTL):** set the token expiration. We recommend the longest your security policy allows; GitHub's maximum for fine-grained tokens is 1 year (366 days).

          <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-token-details.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=e068d148bba44b265bf2300150509405" alt="The new fine-grained token form with token name, resource owner, and expiration fields" width="2954" height="1748" data-path="images/data-sources/lookml-augmentation-token-details.webp" />

    <Warning>
      When this token expires, Orion can no longer pull your LookML repo. Schema sync and the nightly enrichment that reads your LookML will fail with an authentication error, and any insights that depend on that business logic go stale until you issue a new token and update the connection. Set a reminder to rotate the token before it expires.
    </Warning>
  </Step>

  <Step title="Select the repository">
    Choose the Looker repository from the dropdown.
  </Step>

  <Step title="Set permissions">
    Grant read-only access, nothing more:

    * **Contents:** Read-only
    * **Metadata:** Read-only

          <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-permissions.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=62373156cb7480e5bfa2c1f01940089a" alt="Repository access set to the LookML repo, with Contents and Metadata permissions set to Read-only" width="2208" height="1756" data-path="images/data-sources/lookml-augmentation-permissions.webp" />
  </Step>

  <Step title="Create the token">
    Generate the token and copy it. You will not be able to view it again.
  </Step>

  <Step title="Save the configuration">
    Back in Orion, enter the repository URL, the PAT, and the rest of the configuration (see the **Augmentation** tab in Step 2), then save.
  </Step>

  <Step title="Grant the token's account access to the repository">
    The account that owns the token must have at least **Read** access to the LookML repo, or Orion authenticates but cannot see the repo and the connection fails with "repository not found."

    A repository admin:

    1. In GitHub, open the LookML repository → **Settings → Collaborators and teams** (under **Access**).
    2. Under **Manage access**, click **Add people** (or **Add teams** if you manage access by team).
    3. Enter the username of the account tied to the token, or the service account created for Orion.
    4. Set the role to **Read**. No write or admin access is required.
    5. Send the invitation.
    6. The account owner **accepts the invite**. Until they do, access does not take effect and the connection will still fail.
    7. Return to the Orion connection and reconnect.

           <img src="https://mintcdn.com/gravity-8db392ea/SRvR0atcQQsuOWU3/images/data-sources/lookml-augmentation-repo-access.webp?fit=max&auto=format&n=SRvR0atcQQsuOWU3&q=85&s=1d85619fdc8314c4e9aeb7fe27aac9e0" alt="The LookML repository's Collaborators and teams page in GitHub, under Settings, with the Add people option" width="2862" height="1118" data-path="images/data-sources/lookml-augmentation-repo-access.webp" />

    <Tip>
      Use a shared service account rather than an individual's personal account. If a person leaves or loses access, a personal-account token breaks the connection.
    </Tip>
  </Step>

  <Step title="Test the connection">
    On the **Augmentation** tab, click **Test Connection**. This verifies that Orion can reach the repository with the token and branch you configured, without running a full sync.

    * **Success:** the connection is valid. Orion can authenticate and see the repo. Click **Sync Now** to pull the LookML files. When it finishes, **Status** shows **Synced**, along with the file count and the latest commit.
    * **Failure:** read the error message:
      * **"Repository or branch not found"** usually means the token's account lacks Read access to the repo (revisit Step 9), or the branch name is wrong. Leave **Branch** blank to use the repo default, or enter the correct branch.
      * **"Authentication failed"** means the token is invalid or expired. Generate a new one (Steps 3-7) and re-enter it.
      * **"Access forbidden"** means the token is missing a permission or, if your org enforces SSO, has not been SSO-authorized for the organization.
  </Step>
</Steps>

Once the test passes and the first sync completes, Orion is reading your LookML.

[↑ Back to all data sources](#choose-your-data-source)

***

## PostgreSQL

Orion connects to PostgreSQL with username/password authentication. Create a dedicated read-only user and grant it `SELECT` on the schemas and tables you want analyzed.

**Connection information**

| Field        | Description                                                              |
| ------------ | ------------------------------------------------------------------------ |
| **Host**     | PostgreSQL server hostname / IP address                                  |
| **Port**     | PostgreSQL server port (default: `5432`)                                 |
| **Database** | Target database name                                                     |
| **User**     | PostgreSQL username for authentication                                   |
| **Password** | User password for authentication                                         |
| **SSL Mode** | `disable` / `allow` / `prefer` / `require` / `verify-ca` / `verify-full` |

**Required grants**

```sql theme={null}
GRANT CONNECT ON DATABASE <db> TO <user>;
GRANT USAGE ON SCHEMA <schema> TO <user>;
GRANT SELECT ON ALL TABLES IN SCHEMA <schema> TO <user>;
-- So future tables are visible automatically:
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema> GRANT SELECT ON TABLES TO <user>;
```

**Setup**

<Steps>
  <Step title="Create the service user">
    ```sql theme={null}
    CREATE USER orion_svc WITH PASSWORD '<secure_password>';
    ```
  </Step>

  <Step title="Configure PostgreSQL for connections">
    In `postgresql.conf`: set `listen_addresses = '*'` so PostgreSQL accepts connections, and `ssl = on` for SSL connections.
  </Step>

  <Step title="Configure client authentication">
    In `pg_hba.conf`:

    ```text theme={null}
    host    <database> orion_svc <ip_range> md5
    hostssl <database> orion_svc <ip_range> md5   # SSL-only
    ```
  </Step>

  <Step title="Restart and grant">
    Restart the PostgreSQL service, then assign the grants listed above to the service user.
  </Step>

  <Step title="Enter the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **Postgres**. Enter the connection information from the table above (host, port, database, user, password, SSL mode).
  </Step>
</Steps>

**What we store:** username/password authentication; we encrypt your plain-text password in our database. See the PostgreSQL docs on [connection parameters](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS), [access control](https://www.postgresql.org/docs/current/ddl-priv.html), and [client authentication](https://www.postgresql.org/docs/current/client-authentication.html).

[↑ Back to all data sources](#choose-your-data-source)

***

## MySQL

Orion connects to MySQL with username/password authentication. Create a dedicated user and grant it read-only access to the target database.

**Connection information**

| Field                             | Description                                                                                                                            |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| **Host**                          | MySQL server hostname / IP address                                                                                                     |
| **Port**                          | MySQL server port (default: `3306`)                                                                                                    |
| **Database**                      | Target database (schema) name                                                                                                          |
| **User**                          | MySQL username for authentication                                                                                                      |
| **Password**                      | User password for authentication                                                                                                       |
| **SSL Mode**                      | `disable` / `preferred` / `required` / `verify-ca` / `verify-identity`                                                                 |
| **SSL CA Certificate** (optional) | PEM-encoded CA bundle, required for `verify-ca` / `verify-identity` when the server certificate is not signed by a publicly trusted CA |

<Note>
  In MySQL, a "database" and a "schema" are the same thing. The **Database**
  value above is the schema Orion will read from.
</Note>

**Required grants**

```sql theme={null}
-- Read-only access to all current and future tables/views in <db>
GRANT SELECT, SHOW VIEW ON <db>.* TO '<user>'@'<host_or_%>';
FLUSH PRIVILEGES;
```

**Setup**

<Steps>
  <Step title="Create the service user">
    ```sql theme={null}
    CREATE USER 'orion_svc'@'<host_or_%>' IDENTIFIED BY '<secure_password>';
    ```

    Replace `<host_or_%>` with the IP/CIDR Orion will connect from (e.g. `'orion_svc'@'10.0.0.0/8'`), or use `'%'` to allow any source.
  </Step>

  <Step title="Configure MySQL for connections">
    Ensure MySQL accepts remote connections in `my.cnf` (or `mysqld.cnf`):

    ```ini theme={null}
    [mysqld]
    bind-address = 0.0.0.0
    # For SSL:
    require_secure_transport = ON
    ssl-ca   = /path/to/ca.pem
    ssl-cert = /path/to/server-cert.pem
    ssl-key  = /path/to/server-key.pem
    ```

    Optionally require SSL for this user only: `ALTER USER 'orion_svc'@'<host_or_%>' REQUIRE SSL;`
  </Step>

  <Step title="Restart and grant">
    Restart the MySQL service, then assign the grants listed above to the service user.
  </Step>

  <Step title="Enter the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **MySQL**. Enter the connection information from the table above (host, port, database, user, password, SSL mode, and the CA certificate if applicable).
  </Step>
</Steps>

**What we store:** username/password authentication; we encrypt your plain-text password at rest. If you provide an SSL CA certificate, we encrypt the PEM contents alongside it. See the MySQL docs on [access control](https://dev.mysql.com/doc/refman/8.0/en/access-control.html) and [encrypted connections](https://dev.mysql.com/doc/refman/8.0/en/encrypted-connections.html).

[↑ Back to all data sources](#choose-your-data-source)

***

## Redshift

Orion connects to Amazon Redshift (cluster or Serverless workgroup) over the standard PostgreSQL wire protocol (port `5439`) using username/password authentication. Orion only ever issues read (`SELECT`) queries.

**Connection details**

| Field        | Description                                                                                                                                                                  |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Host**     | Your cluster endpoint, e.g. `my-cluster.abc123xyz.us-east-1.redshift.amazonaws.com`. For Serverless: `my-workgroup.123456789012.us-east-1.redshift-serverless.amazonaws.com` |
| **Port**     | Defaults to `5439`                                                                                                                                                           |
| **Database** | The database name to connect to, e.g. `analytics` or `dev`                                                                                                                   |
| **User**     | The read-only user created for Orion (we suggest `orion`)                                                                                                                    |
| **Password** | The password for that user                                                                                                                                                   |
| **SSL Mode** | `require` (default; Redshift clusters always terminate TLS)                                                                                                                  |

**Database user & permissions**

<Note>
  On Redshift, a user can only see a table in `information_schema` if it has
  been granted access, so these grants also determine what Orion can discover.
</Note>

```sql theme={null}
CREATE USER orion PASSWORD '<choose-a-strong-password>';
-- For each schema you want Orion to access:
GRANT USAGE ON SCHEMA <schema_name> TO orion;
GRANT SELECT ON ALL TABLES IN SCHEMA <schema_name> TO orion;
-- So future tables are visible automatically:
ALTER DEFAULT PRIVILEGES IN SCHEMA <schema_name> GRANT SELECT ON TABLES TO orion;
```

<Warning>
  Orion does not need `INSERT` / `UPDATE` / `DELETE` / `CREATE`, so please do
  not grant write access.
</Warning>

**Network access:** Orion connects from our infrastructure, so the endpoint must be reachable on the Redshift port. Allow inbound traffic on port `5439` from Orion's egress IP range in the cluster's VPC security group. See the docs on [managing Redshift security groups](https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-security-groups.html).

**Enter the connection in Orion:** go to **Configuration → Data Sources**, click **Add Data Source**, choose **Amazon Redshift**, and enter the connection details from the table above.

[↑ Back to all data sources](#choose-your-data-source)

***

## Amazon Athena

Orion connects to Amazon Athena to run serverless SQL over data in S3. Table and column metadata comes from your **AWS Glue Data Catalog**; queries run through Athena and write their results to an S3 **output location** you control. Orion only ever issues read (`SELECT`) queries against your tables.

Authentication uses an **IAM access key** for a dedicated user. You create the user, attach a least-privilege policy, and enter the access key ID and secret in Orion.

<Note>
  Every Athena query must write its results somewhere in S3. This is an Athena
  requirement, not an Orion one: the output location (or a workgroup that
  enforces one) is where Athena stages query output before Orion reads it. The
  IAM user therefore needs **write** access to that one output prefix, even
  though it only reads your actual data.
</Note>

**Connection details**

| Field                     | Description                                                   | Example                          |
| ------------------------- | ------------------------------------------------------------- | -------------------------------- |
| **AWS Access Key ID**     | Access key ID for the dedicated IAM user                      | `AKIA...`                        |
| **AWS Secret Access Key** | Secret access key for that user                               | *(sensitive)*                    |
| **Region**                | AWS region where Athena and your Glue catalog live            | `us-east-1`                      |
| **S3 Output Location**    | S3 URI where Athena stages query results (must end in `/`)    | `s3://my-bucket/athena-results/` |
| **Workgroup**             | Athena workgroup to run queries under (defaults to `primary`) | `primary`                        |
| **Data Catalog**          | Athena data catalog name (defaults to `AwsDataCatalog`)       | `AwsDataCatalog`                 |
| **Database** *(optional)* | Scope schema exploration to a single Glue database            | `analytics`                      |

<Warning>
  Orion reads the chosen **workgroup's query history** to learn which tables and
  columns your team queries most. That history includes the **SQL text** of
  every query run in the workgroup. If that is a concern, point Orion at a
  dedicated workgroup rather than one shared with sensitive ad-hoc queries.
</Warning>

**IAM setup**

<Steps>
  <Step title="Create a dedicated IAM user">
    In the AWS IAM console, create a user for Orion (we suggest `orion-athena`) with **programmatic access**, then create an access key for it. Copy the **Access Key ID** and **Secret Access Key**; the secret is only shown once.
  </Step>

  <Step title="Attach a least-privilege policy">
    Attach a policy granting Athena execution, read-only Glue catalog access, read access to the S3 buckets holding your data, and read/write access to the S3 output location. Scope the resource ARNs to your own buckets, workgroup, and catalog. The policy below is a starting point:

    ```json theme={null}
    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Sid": "AthenaQueries",
          "Effect": "Allow",
          "Action": [
            "athena:StartQueryExecution",
            "athena:StopQueryExecution",
            "athena:GetQueryExecution",
            "athena:GetQueryResults",
            "athena:GetWorkGroup",
            "athena:ListWorkGroups",
            "athena:ListQueryExecutions",
            "athena:BatchGetQueryExecution"
          ],
          "Resource": "*"
        },
        {
          "Sid": "GlueCatalogReadOnly",
          "Effect": "Allow",
          "Action": [
            "glue:GetDatabase",
            "glue:GetDatabases",
            "glue:GetTable",
            "glue:GetTables",
            "glue:GetPartition",
            "glue:GetPartitions"
          ],
          "Resource": "*"
        },
        {
          "Sid": "S3ReadData",
          "Effect": "Allow",
          "Action": ["s3:GetObject", "s3:ListBucket", "s3:GetBucketLocation"],
          "Resource": [
            "arn:aws:s3:::my-data-bucket",
            "arn:aws:s3:::my-data-bucket/*"
          ]
        },
        {
          "Sid": "S3ReadWriteResults",
          "Effect": "Allow",
          "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket", "s3:GetBucketLocation"],
          "Resource": [
            "arn:aws:s3:::my-bucket",
            "arn:aws:s3:::my-bucket/athena-results/*"
          ]
        }
      ]
    }
    ```

    <Tip>
      Tighten `ListQueryExecutions` / `BatchGetQueryExecution` and the Glue and
      Athena actions to specific workgroup, catalog, and database ARNs if you
      want to lock the user down further. The `ListQueryExecutions` /
      `BatchGetQueryExecution` pair is only used for the query-history
      enrichment described above; omit them if you'd rather not expose query
      history.
    </Tip>
  </Step>

  <Step title="Confirm the workgroup and output location">
    Make sure the workgroup you name exists in the chosen region, and that either the workgroup enforces an output location or the **S3 Output Location** you enter is writable by the IAM user. If the workgroup enforces its own output location, that setting wins over the value you enter in Orion.
  </Step>

  <Step title="Enter the connection in Orion">
    In Orion, go to **Configuration → Data Sources**, click **Add Data Source**, and choose **Amazon Athena**. Enter the connection details from the table above. Leave **Workgroup** and **Data Catalog** at their defaults (`primary` / `AwsDataCatalog`) unless you use custom ones, and set **Database** only if you want to limit schema discovery to one Glue database.
  </Step>
</Steps>

**Network access:** Athena and Glue are reached over their public AWS API endpoints, so no VPC allowlisting is required for the connection itself. If your S3 buckets restrict access by source IP or VPC endpoint policy, allow Orion's egress IP range (provided by your Gravity contact) to reach them.

**What we store:** the IAM access key ID and secret access key, encrypted at rest in our database. To rotate the key later, enter the new values on the data source's **Connection** tab and save; leave the secret blank to keep the current one.

**Known limitations**

* **IAM access key only.** Cross-account IAM role assumption is a planned fast-follow; today the connection uses a long-lived access key, so rotate it on your normal cadence.
* **Output location is mandatory.** Athena cannot run a query without a place to write results, so the workgroup must enforce one or you must supply the **S3 Output Location**.
* **dbt enrichment** is supported on Athena connections (see [dbt](#dbt)); semantic enrichment from a Looker connection can also be projected onto Athena schemas.

[↑ Back to all data sources](#choose-your-data-source)

***

## Microsoft Fabric

Orion connects to a Microsoft Fabric Warehouse using a **Service Principal** (App Registration) in your Microsoft Entra ID tenant. Orion connects over TDS (the SQL endpoint) using ODBC Driver 18 with Service Principal authentication, with no interactive login required.

**Azure App Registration**

1. Create an App Registration in your Entra ID tenant ([docs](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app))
2. Note the **Application (client) ID** and **Directory (tenant) ID**
3. Create a **Client Secret** under **Certificates & secrets** ([docs](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#add-credentials)) and note the secret **value** (not the Secret ID). Recommended expiry: 12 months

**Fabric Admin Portal settings** (must be enabled by a Fabric Administrator)

1. Navigate to **Fabric Admin Portal → Tenant settings → Developer settings**
2. Enable **Service principals can use Fabric APIs**
3. Scope to a security group containing the Orion Service Principal (recommended), or enable for the entire organization

**Workspace access:** Open the workspace containing your Warehouse, click **Manage access → Add people or groups**, search for the App Registration name, and assign the **Viewer** role (minimum). Contributor is recommended for full metadata access.

**Warehouse SQL endpoint:** Open the Warehouse in Fabric, click **Settings → SQL connection string**. The hostname looks like `xxxxxxxx.datawarehouse.fabric.microsoft.com`. Note the **Database** name (the Warehouse name).

**Credentials summary**

| Field               | Description                                   | Example                                  |
| ------------------- | --------------------------------------------- | ---------------------------------------- |
| **Server Hostname** | SQL connection string from Warehouse settings | `xyz.datawarehouse.fabric.microsoft.com` |
| **Database**        | Warehouse name                                | `my-warehouse`                           |
| **Tenant ID**       | Entra ID Directory (tenant) ID                | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`   |
| **Client ID**       | App Registration Application (client) ID      | `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`   |
| **Client Secret**   | App Registration client secret value          | *(sensitive)*                            |

**Enter the connection in Orion:** go to **Configuration → Data Sources**, click **Add Data Source**, choose **Microsoft Fabric Warehouse**, and enter the credentials from the table above.

<Note>
  Orion uses read-only SQL (`SELECT` only) to discover your schema via
  `INFORMATION_SCHEMA`, run agent-generated queries, and stream results into its
  analysis pipeline. It never executes DDL, DML, or stored procedures. If you
  use dbt with Fabric, Orion can enrich metadata with dbt models and lineage;
  see [dbt](#dbt).
</Note>

[↑ Back to all data sources](#choose-your-data-source)

***

## Delta Lake

Orion connects to Delta Lake tables on **Azure Data Lake Storage Gen2** (`abfss://`) or **Google Cloud Storage** (`gs://`). Orion reads the Delta table directly via its transaction log. There is no warehouse, cluster, or notebook to provision.

You provide two things: a **Table URI** pointing at a Delta table folder (or a parent folder containing many Delta tables), and **credentials** with read access to that location.

<Note>
  Orion only performs read-only scans against your storage account / bucket: no
  writes, no vacuums, no schema changes.
</Note>

<Tabs>
  <Tab title="Azure Data Lake Storage Gen2">
    **Storage account access**

    * The Table URI looks like `abfss://<container>@<storage-account>.dfs.core.windows.net/<path>`
    * `<path>` can point to a single Delta table folder (containing a `_delta_log/` subdirectory) or a parent folder; in the parent case, Orion exposes every Delta table found underneath
    * Confirm **hierarchical namespace** is enabled on the storage account (required for `abfss://`)

    **Credentials (pick one)**

    <CardGroup cols={2}>
      <Card title="SAS token (preferred)" icon="key">
        Read-only and time-bounded ([docs](https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview)).
        Scope to the container, permissions read + list (`sp=rl`), expiry 90 days
        or longer. Send the token query string (with or without a leading `?`).
      </Card>

      <Card title="Account key" icon="lock">
        Read/write, full access, only if SAS is not viable. Either the raw account
        key, or the full connection string.
      </Card>
    </CardGroup>

    **What you enter in Orion** (under **Configuration → Data Sources → Add Data Source → Delta Lake**): Table URI (full `abfss://...` string), storage account name (required for SAS tokens), and one of SAS token or account key.
  </Tab>

  <Tab title="Google Cloud Storage">
    **Bucket access**

    * The Table URI looks like `gs://<bucket>/<path>`
    * As with Azure, `<path>` can be a single Delta table folder or a parent folder containing many Delta tables

    **Credentials (pick one)**

    <CardGroup cols={2}>
      <Card title="HMAC key & secret" icon="key">
        Create HMAC keys for a service account that has `roles/storage.objectViewer`
        (or finer-grained access) on the target bucket.
      </Card>

      <Card title="Application Default Credentials" icon="id-badge">
        Workload identity, with no secret to share. Grant the Orion workload
        identity your contact provides `roles/storage.objectViewer` on the bucket.
      </Card>
    </CardGroup>

    **What you enter in Orion** (under **Configuration → Data Sources → Add Data Source → Delta Lake**): Table URI (full `gs://...` string), and one of HMAC key ID + secret, or confirmation from your Gravity contact that workload identity is configured.
  </Tab>
</Tabs>

<Tip>
  **Parent-folder mode:** point the Table URI at a parent directory (e.g.
  `abfss://.../silver/`) and Orion discovers every Delta table underneath on
  schema sync. Partition columns need no setup; Orion reads them from the Delta
  log for query pruning automatically.
</Tip>

[↑ Back to all data sources](#choose-your-data-source)

***

## dbt

If you use dbt, Orion can enrich an existing warehouse connection with your dbt model descriptions and lineage. You connect Orion to your dbt project's GitHub repository with a read-only fine-grained access token.

<Steps>
  <Step title="Create a GitHub Personal Access Token">
    1. Navigate to **Settings → Developer Settings → Personal access tokens → Fine-grained tokens**
    2. Click **Generate new token**
    3. Set your organization as the resource owner (if required)
    4. Configure permissions: **Contents** → Read access (**Metadata** is auto-added)
    5. Under **Repository access**, select **Only select repositories** and add your dbt project repo only
    6. Click **Generate token**, then copy and save it immediately; it won't be shown again
  </Step>

  <Step title="Configure the Orion connection">
    1. In Orion, go to **Configuration → Data Sources**
    2. Click the data source tile you want to enrich, then click **Edit**. (The same options appear when first adding a data source.)
    3. Check **Add schema enrichment for enhanced metadata** and select **dbt project**
    4. Set **dbt Source Type** to **GitHub Repository**
    5. Enter the **Repository URL** (your dbt project's GitHub URL) and **Personal Access Token**
    6. Click **Save Changes**

           <img src="https://mintcdn.com/gravity-8db392ea/78erJbwdyaEmpWgN/images/data-sources/dbt-schema-enrichment.webp?fit=max&auto=format&n=78erJbwdyaEmpWgN&q=85&s=ae7d126673be28f5612816c56d7320cd" alt="A data source in edit mode with schema enrichment enabled and dbt project selected" width="1440" height="1400" data-path="images/data-sources/dbt-schema-enrichment.webp" />

    <Warning>
      Make sure there's no trailing slash at the end of the Repository URL.
    </Warning>

    <Note>
      **dbt Source Type** also supports **dbt Cloud** (host URL, environment ID,
      and auth token) and **Upload manifest.json** if you'd rather not connect
      the GitHub repository.
    </Note>
  </Step>
</Steps>

<Note>
  Standard dbt projects only require these two fields, **Repository URL** and
  **Personal Access Token**. Additional fields are optional.
</Note>

[↑ Back to all data sources](#choose-your-data-source)
