Skip to content

dbt Core

Only use the following steps for "dbt Core" environments. If you have a dbt Cloud environment, use the required config instructions for "dbt Cloud" environments

Need to setup environment variables? Refer to this section

This method will save a bunch of time for you, and you can also validate your configuration. Setup wizard will help you in associating sql files with jinja-sql, selecting the right Python interpreter, make sure dbt dependencies are correctly installed etc. In the end, it will also validate your configuration.

You can start the setup wizard by clicking on dbt status icon in bottom status bar, and perform following necessary steps as shown in click-through demo below:

Here are steps covered in the setup wizard

Select Python Interpreter

Click on the action button - "Select Python Interpreter" and choose your preferred python interpreter. Usually, choosing interpreter that's recommended, or mapped to your virtual environment software (e.g. venv) as per the list is a good idea. If you know the path of your Python envionment, you can choose it from the list or if the path is not present there, you can enter it manually.

If needed, please run 'where python' command on terminal to see if it shows path to Python interpreter that you are using.

Install dbt

If dbt is not installed in your environment (dbt status icon on bottom status bar will show it), Click on "Install dbt" button in the next step. It will ask for dbt version and adapter that's need for your database environment (e.g. Snowflake). Based on these inputs, setup wizard will automatically install dbt in your environment

Install dbt deps

Many times project failures or weird errors are seen if dbt dependencies are not installed. In this step, once you click on 'Run dbt deps' button, setup wizard will automatically run dbt deps command for your project.

Validate Project

Last step is clicking on button - "Validate Project" It will run a bunch of checks to make sure your dbt environment and project are setup correctly. If there are some issues, it will tell you exactly what's wrong as well.

If you still can't get the extension setup correctly, please contact us via slack or chat through support page

Manual method of configuration

Please follow the manual method only if you couldn't use the setup wizard above.

Associate *.sql files with jinja-sql

There are two different methods to do this. Please follow only one method:

Method1: Configure in Preferences > Settings in the extension

File Associations

Method2: Update the settings.json file directly

Type ‘settings.json’ in the VS Code command pallet to open it

Open Settings.json

and add following lines at the end of settings.json

    "files.associations": {
        "*.sql": "jinja-sql",
        "*.yml": "jinja-yaml"
    },

Associate Python Interpreter with dbt installation

Ensure that the Python interpreter selection is always visible on the bottom strip of the VS Code for ease of use:

Enable python interpreter visibility by updating VSCode settings

Enable Python interpreter visibility

Select the Python interpreter that has dbt installed.

Select Python interpreter

Tip

If you select a python environment with dbt already installed, the dbt label on the bottom strip of the VS Code will show a checkmark.

If dbt is shown as not installed in the extension, the extension can install dbt for you automatically - just click on the dbt status icon on the bottom strip of the VSCode.

Warning for Python path overrides

Avoid using the setting dbt.dbtPythonPathOverride unless using Meltano, the extension depends on the Python interpreter for visual code compatible environment variable parsing.

Enable preview features by adding API key

There are multiple preview features in the extension including generate dbt documentation, column lineage, query explanation, generate dbt model from SQL that require an API key.

You can get an API key for free by signing up at www.altimate.ai

You need to add the API key from "Settings->API key" in your Altimate instance to the VSCode extension settings. You also need to add "Instance name" in the extension settings. Please get your instance name from your Altimate AI URL. If your URL for Altimate instance is - "companyx.app.myaltimate.com", then instance name is "companyx".

Go to VSCode extension settings, and add API key and instance name there.

Here's demo of how to add instance name and API Key to the extension settings