DataSpell 2024.1 Help

dbt support

DataSpell supports dbt® Core — an open-source data modeling tool, that allows users to transform, test, and deploy data in their data warehouses using SQL.

Enable the Database Tools and SQL plugin

This functionality relies on the Database Tools and SQL plugin, which is bundled and enabled in DataSpell by default. If the relevant features aren't available, make sure that you didn't disable the plugin.

  1. Press Ctrl+Alt+S to open the IDE settings and then select Plugins.

  2. Open the Installed tab, find the Database Tools and SQL plugin, and select the checkbox next to the plugin name.

dbt support in DataSpell includes:

  • Effortless project creation: you can create your dbt® project using a predefined template.

  • Easy run, build, and debug: execute, build, or debug your project with Run/debug configurations in just a few clicks.

  • Quick access to dbt actions: run, test and preview models directly from an SQL file using the Gutter icons.

  • Intelligent code completion: DataSpell offers smart code completion for SQL and YML files.

Get familiar with the user interface

Run/debug configurations

To run a dbt command, select the dbt configuration from the list of run/debug configurations in the main toolbar and click Run.

Select dbt configuration

You can create your own dbt configuration.

  1. Do one of the following:

    • Go to Run | Edit Configurations.

    • In the main toolbar, select Edit Configurations from the list of run/debug configurations.

  2. Press Alt+Insert or click Add New Configuration.

  3. Select dbt.

    Select dbt from the list
  4. Specify configuration name and select command from the dbt command list.

    dbt configuration settings
  5. Specify additional arguments.

  6. Select Module.

  7. Set environment variables, if necessary. For example, you might use environment variables to manage different database connections for development, testing, and production environments.

  8. If you want to execute any task before the dbt command, click Add in the Before launch field and select a task.

  9. Click OK to save the configuration.

Gutter icons

Gutter icons are located in the editor on the left. You can use them to execute dbt commands:

  1. Open an SQL file with your model.

  2. Click Run with dbt icon in the gutter. The list of the Gutter icons appears.

    dbt Gutter icons
  3. Click the icon to run a dbt command.

Gutter icon

dbt command

Run model

dbt run --select model.sql

Test model

dbt test --select model.sql

Preview model

dbt show --select model.sql

Last modified: 29 March 2024