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

# Databricks

> Connect a Databricks SQL warehouse to Genloop with a personal access token, scope access to a Unity Catalog catalog, and query your lakehouse in natural language.

Genloop connects to a Databricks SQL warehouse over an encrypted (HTTPS) connection using a personal access token. It reads the tables you select and never writes to your workspace.

## Before you connect

* A Databricks user or service principal with read access to the tables you want to query.
* A running SQL warehouse and its HTTP path.
* If your workspace has an IP access list, allow Genloop's regional IP address. See [Before you begin](/using-genloop/connections/connect-a-database#before-you-begin).

## Connection fields

| Field               | Description                                                                            |
| ------------------- | -------------------------------------------------------------------------------------- |
| **Connection name** | A name to identify this connection in Genloop                                          |
| **Server hostname** | Your Databricks workspace hostname, for example `adb-1234567890.1.azuredatabricks.net` |
| **HTTP path**       | HTTP path of your SQL warehouse, found under its connection details                    |
| **Access token**    | A personal access token for authentication                                             |
| **Catalog**         | Optional. Unity Catalog catalog to use. Defaults to the workspace default              |

## Generate an access token

<Steps>
  <Step title="Open User Settings">
    In your Databricks workspace, click your username and open **User Settings → Developer**.
  </Step>

  <Step title="Create the token">
    Click **Generate new token**, set an expiry, and copy the value.
  </Step>

  <Step title="Add it to Genloop">
    Paste the token into the **Access token** field in the connection form.
  </Step>
</Steps>

## Encryption and network

Genloop reaches Databricks over the internet using an encrypted (HTTPS) connection. There is no SSL setting to configure, and an SSH tunnel is not used.

## Permissions

Genloop only reads your data and never writes to your workspace. You can connect with any user or service principal that already has read access to the tables you select.

If you want a dedicated read-only identity for Genloop, ask your Databricks administrator to set one up.

<Accordion title="Minimal read-only access (for your Databricks administrator)">
  Grant the identity `CAN USE` on the SQL warehouse, then run this for the data it should read:

  ```sql theme={null}
  GRANT USE CATALOG ON CATALOG your_catalog TO `genloop_user`;
  GRANT USE SCHEMA ON SCHEMA your_catalog.your_schema TO `genloop_user`;
  GRANT SELECT ON TABLE your_catalog.your_schema.your_table TO `genloop_user`;
  ```
</Accordion>

## Next steps

<CardGroup cols={2}>
  <Card title="Connect a database" icon="database" href="/using-genloop/connections/connect-a-database">
    Back to the full connection flow.
  </Card>

  <Card title="Context Hub" icon="brain" href="/using-genloop/context-hub">
    View and edit the memory built from your connection.
  </Card>
</CardGroup>
