# dbt

## Before you start

To connect dbt to Select Star, you will need...

* Permission to build the dbt project

{% hint style="info" %}
Select Star won't need any permissions for dbt directly, but you will need to build the dbt project and generate build artifacts.
{% endhint %}

Complete the following steps to connect dbt to Select Star.

1. [Determine what kind of dbt connection you need](#1.-determine-what-kind-of-dbt-connection-you-need)
2. [Connect dbt to Select Star](#2.-connect-dbt-to-select-star)

{% hint style="warning" %}
Note that in order to see changes to your dbt project reflected in Select Star after the initial connection, **you must** complete either [step 3](#3.-updating-build-artifacts-automatically) or [step 4](#4.-updating-build-artifacts-manually).
{% endhint %}

## 1. Determine what kind of dbt connection you need

Select Star can integrate with dbt via dbt cloud or via build artifacts (manifest.json, catalog.json, etc).

for DBT Cloud we require...

* a service token for the metadata api
* a job id for a custom job that will generate all the metadata we need
  * see [DBT Cloud - Setup a dbt Cloud Custom Job](https://docs.selectstar.com/integrations/dbt-cloud#dbt-cloud-custom-job) for details about how to set up the job
* a `Read Only` and `Metadata Only` permission set

## 2. Connect dbt to Select Star

{% hint style="info" %}
If you are using multiple dbt projects and have cross-project dependencies see [dbt-project-dependencies](https://docs.selectstar.com/integrations/dbt/dbt-project-dependencies "mention").
{% endhint %}

Go to the Select Star **Settings**. Click **Data** in the sidebar, then **+ Add** to create a new Data Source.

![](https://3470314135-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MgAiVthA_yg9UXKuhyY%2Fuploads%2Fgit-blob-1b5ef3716637dedbfa0eb69326a83270b0773b0b%2FAdd_Data_Source_Settings.gif?alt=media)

Choose **dbt** in the Source Type dropdown and then follow the instructions for how you want to connect:

{% content-ref url="dbt/dbt-cloud" %}
[dbt-cloud](https://docs.selectstar.com/integrations/dbt/dbt-cloud)
{% endcontent-ref %}

{% content-ref url="dbt/dbt-core-open-source" %}
[dbt-core-open-source](https://docs.selectstar.com/integrations/dbt/dbt-core-open-source)
{% endcontent-ref %}

### Features

{% content-ref url="dbt/dbt-tags-new" %}
[dbt-tags-new](https://docs.selectstar.com/integrations/dbt/dbt-tags-new)
{% endcontent-ref %}

{% content-ref url="dbt/dbt-tests-beta" %}
[dbt-tests-beta](https://docs.selectstar.com/integrations/dbt/dbt-tests-beta)
{% endcontent-ref %}
