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

# ThoughtSpot

ThoughtSpot connects to Honeydew via JDBC connection, using the **Trino** protocol.

## Setting up a new data warehouse connection

ThoughtSpot data warehouse connections are mapped to a Honeydew workspace and branch

<Tip>
  It is recommended to use an [API Key](/docs/access-control/api-keys) for setting up the connection.
</Tip>

1. Create a new data warehouse connection
2. Enter a name for the connection (e.g. "Honeydew")
3. Choose **Trino** from the list of supported data warehouses
4. Click **Continue** to move to the connection settings
5. Set **Host** to `jdbc.honeydew.cloud`
6. Set **Port** to `443`
7. Set **Username** to the API key (or a Honeydew username), and **Password** to the API secret
   (or to the user's password in Honeydew).
8. Set **Database** to `<workspace>__<branch>` value, based on the Honeydew `workspace` and `branch` you would like to connect to.
   Omit the branch value if connecting to `prod`.
   For example, for workspace `tpch`, branch `prod`, the value would be: `tpch`.
   And for workspace `tpch`,  branch `dev`, it would be `tpch__dev`.
9. Click **Continue**
10. Select the domain you would like to connect to, and check the columns you would like to include in the connection.
11. Click **Create Connection** to create the connection

<Note>
  If your organization uses a custom hostname for the JDBC connection,
  you can locate it in the Honeydew UI, under the **JDBC** section in **Settings**.
</Note>

You can now run queries or create reports on top of the Honeydew data warehouse connection, using the ThoughtSpot user interface.

## Metadata Sync

Honeydew automatically converts Honeydew metadata properties to ThoughtSpot metadata properties,
by generating a ThoughtSpot TML file.

Honeydew synchronizes the following metadata to ThoughtSpot:

* Fields - every attribute is defined as a ThoughtSpot attribute, and every metric as a ThoughtSpot measure.
* Field data types.
* Field display names (to ThoughtSpot field names). When no display name is set, Honeydew creates an automatic user friendly name.
* Measure aggregations. Note that Honeydew can support any SQL aggregation function as a measure, hence
  the measure type is not always a direct mapping to ThoughtSpot measure types.
* Field hidden property (to `is_hidden` ThoughtSpot field property).
* Field descriptions (to `description` ThoughtSpot field property).
* Field format string (to `format_pattern` ThoughtSpot field property).
* Synonyms, as defined in the Honeydew AI metadata section (to `synonyms` ThoughtSpot field property).

In addition, the following metadata properties are also synchronized:

### ThoughtSpot-specific Metadata

**Metrics and Calculated Attributes**: You can add ThoughtSpot-specific metadata that specifies
formatting, geographical configuration and currency configuration.
For [metrics](/docs/calculations/metrics#yaml-schema) and
[calculated attributes](/docs/calculations/attributes#yaml-schema),
add it to the field's own YAML file:

```yaml theme={null}
...
metadata:
  - name: thoughtspot
    metadata:
      - name: format_pattern
        value: '0.00%'
      - name: geo_field_type
        value: 'latitude' / 'longitude' / 'country' / 'region_name'
      - name: geo_field_country (Optional - only for geo_field_type = 'region_name')
        value: 'United States' / 'United Kingdom' / etc...
      - name: geo_field_region_name (Optional - only for geo_field_type = 'region_name')
        value: 'zip code' / 'postal code' / 'county' / 'district' / etc...
      - name: currency_type_browser (Optional)
        value: 'true'
      OR
      - name: currency_type_iso_code (Optional)
        value: 'USD' / 'EUR' / etc...
      OR
      - name: currency_type_column (Optional)
        value: 'entity_name.currency_type_field_name'
```

For [dataset attributes](/docs/modeling/source-data#yaml-schema), add the metadata under
the attribute entry in the dataset's YAML file:

```yaml theme={null}
...
attributes:
  ...
  - column: <src column name>
    name: <attribute name>
    ...
    metadata:
      - name: thoughtspot
        metadata:
          - name: format_pattern
            value: '0.00%'
```

* For additional information on **format patterns**, see ThoughtSpot [documentation](https://docs.thoughtspot.com/cloud/10.10.0.cl/data-modeling-patterns).
* For more information on **geographical configuration** or **currency configuration**,
  see ThoughtSpot [TML for tables documentation](https://docs.thoughtspot.com/cloud/10.10.0.cl/tml-tables).

### Using the Honeydew semantic model in ThoughtSpot

You can use the TML generated by Honeydew to create a new table or update an existing one within ThoughtSpot,
using the Honeydew data warehouse connection.
