# dbt (Cloud Version)

{% hint style="info" %}
This documentation is for the cloud version of dbt which is dbt Cloud. To see documentation on how to connect the open source version of dbt, please check out the documentation for dbt core [here](https://docs.decube.io/transformation-tools/dbt-core).
{% endhint %}

## Supported Capabilities

{% tabs %}
{% tab title="Supported Capabilities" %}
**General**

* **Metadata** — metadata extraction and display of asset information (tables, columns, schemas). Types collected: Schema, Virtual Table, Virtual Column, Data Job, Data Run, Data Task

**Data Quality Monitors**

* Job Failure
  {% endtab %}

{% tab title="Not Supported" %}
**General**

* Profiling
* Preview
* Data Quality
* Configurable Collection
* External Table
* View Table
* Stored Procedure

**Data Quality Monitors**

* Freshness
* Volume
* Field Health
* Custom SQL
* Schema Drift
  {% endtab %}
  {% endtabs %}

dbt Cloud can map lineage relationships to upstream and downstream objects from the following connectors:

* Upstream Connectors: postgresql, redshift, snowflake, bigquery, mysql
* Downstream Connectors: postgresql, redshift, snowflake, bigquery, mysql

## Connection Requirements

### Minimum Requirements

{% hint style="success" %}
This connection requires [Service Account Tokens](https://docs.getdbt.com/docs/dbt-cloud-apis/service-tokens) to be generated in dbt Cloud, which is only accessible to dbt accounts on *Team* and *Enterprise* plans.
{% endhint %}

* Service Account API Key
* Account ID
* Tenancy Type
* Access URL (if non DBT multi-tenant)
* Discovery URL (if non DBT multi-tenant)

### Adding a dbt connection on decube.

* From the `My Account` page on decube platform, select on the dbt tile to be brought to the dbt connection form.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-c4e3c9b12ff3833f63b0b379dd330a5361ef09ea%2Fimage.png?alt=media" alt=""><figcaption><p>DBT</p></figcaption></figure>

1. Account ID

* To get your Account ID, you can refer to the numbers at the end of the `accounts` path component of the URL (`https://cloud.getdbt.com/settings/accounts/{account_id}`).

2. API Key

* To get your API Key, please read on to the next section "`Retrieve Service Token from dbt account settings`" to generate your service token for your dbt account.

3. DBT Tenancy Type

* Usually this will be US Multi Tenant for most customers. To verify, check the domain you log in to your DBT with
  * US Multi Tenant - cloud.getdbt.com
  * EMEA Multi Tenant - emea.dbt.com
  * APAC Multi Tenant - au.dbt.com

If your DBT domain contains other URLs, you must choose `Other` as the tenancy type and provide item 4 and 5 mentioned below:

4. Access URL (For `Other` tenancy type)

* Navigate to your DBT Account `Settings` and below the Account Information pane, you can find the Access URL. You can follow the guide from DBT [here](https://docs.getdbt.com/docs/cloud/about-cloud/access-regions-ip-addresses#api-access-urls)

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-124213cc53461402ec8853ea04b9960a2360e2c4%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

5. Discovery URL (For `Other` tenancy type)

* Navigate to your DBT Account `Settings` and below the Account Information pane, you can find the Discovery API URL. You can follow the guide from DBT [here](https://docs.getdbt.com/docs/cloud/about-cloud/access-regions-ip-addresses#api-access-urls)

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-e78e952d8f5bc6e9fedf4aca18d0deca327d140d%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

### Retrieve Service Token from dbt account settings

1. Log into your dbt account. From the `Dashboard`, click on `gear icon` on the top right corner as shown in image, to navigate to Account Settings.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-5695d4fca5f17a634cbad71f40aedcab3fdfe34d%2F1.%20Dashboard%20cropped.png?alt=media" alt=""><figcaption><p>Click on the Account Settings on the top right of the dbt Dashboard.</p></figcaption></figure>

2. Within Account Settings, find the setting for `Service Tokens` on the left sidebar.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-7f72a3c646dd1094a8d1386a183f5915c437f5b8%2F2.%20Account%20Setting%20cropped.png?alt=media" alt=""><figcaption><p>Find Service Tokens in the Account Settings.</p></figcaption></figure>

3. Within the Service Tokens section, click on `+ New Token`.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-46a037c659261f158ef24452175e3191e3d2f524%2F3.%20Service%20Token%20cropped.png?alt=media" alt=""><figcaption><p>Add a new token under the Service Tokens section.</p></figcaption></figure>

4. Within the `New Service Token` page, you can set any token name, such as "decube". Then, click on the `+ Add` button.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-c0aa0969dab06e90e6d70e0098ca77f56b093fc4%2F4.%20%2B%20New%20Token%20cropped.png?alt=media" alt=""><figcaption><p>Give a name and add the permissions.</p></figcaption></figure>

5. Select `Job Admin` and add all the Projects that you would like to connect decube with. Then, click on `Save` at the bottom right.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-ea49ba9f098b70a4eef868004ef82909ca443cb2%2F5.%20%2B%20Add%20cropped.png?alt=media" alt=""><figcaption><p>Setting the correct permissions for the Service Token.</p></figcaption></figure>

6. A token will be generated. Use the `Copy` button to copy the token into your clipboard.

<figure><img src="https://1779874722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTw0qpCVzfrIXqS4FEg4T%2Fuploads%2Fgit-blob-6736b9a636cd3ba754b66996903a24c9705fb7d0%2F6.%20Copy.png?alt=media" alt=""><figcaption><p>Copy the Service Token.</p></figcaption></figure>

7. Insert the Service token that you've copied into the "API Key" of the connection form, then test the connection. If it is successful, you can now add the name and submit the connection.

{% hint style="warning" %}
If there is any issues or questions related with connecting your data sources, please reach out to us via our Live chat for support.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decube.io/transformation-tools/dbt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
