We have discontinued this extension. After a lot of effort we decided our fundamental approach (zetasql) was unworkable. The concept has merit and the right foundation to build on is SQLGlot, if someone else wants to take it up.
Working with dbt Core in Visual Studio Code using the Fivetran Wizard for dbt Core (TM) extension accelerates your first-time environment setup with dbt Core, and optimizes your continual development of transformation pipelines. This extension is designed primarily for BigQuery and Snowflake destinations, but support for other warehouses is in development.
Note: Turning on Auto Save is strongly recommended. This feature enables near real-time query preview, auto-completion, and error highlighting with Wizard for dbt Core (TM).
*dbt Core is a trademark of dbt Labs, Inc. All rights therein are reserved to dbt Labs, Inc. Fivetran Transformations is not a product or service of or endorsed by dbt Labs, Inc.
Note: SQL to ref conversion, error highlighting, auto-completion of columns, tables, and function signature help are only available for BigQuery and Snowflake.
There are two ways to display a compiled query preview.
- Click the Preview icon in the top right corner of your tab
Right click > Wizard for dbt Core (TM) > Show preview
Both methods open the compiled query in a new tab.
If a hardcoded table name can be converted to a dbt ref, the extension can convert that SQL for you automatically, by clicking on the lightbulb icon to the left of the line.
Hover over misspelled column and table names to see suggested fixes. SQL syntax errors are also highlighted for your review. To check the entire project for errors you can use Analyze current project button at upper right corner of VS Code editor or in the context menu (progress is displayed in the status bar).
Hover over SQL functions to see their definitions and required parameters.
If you press Cmd
and hover over a macro, model, or source name, a preview of the declaration will appear.
You can jump to the definition with Cmd+Click
or open the definition to the side with Cmd+Alt+Click
.
If you use BigQuery or Snowflake you can go to column definition with Cmd+Click
.
When you open dbt model you can use status bar items. The following actions are available:
- Change path to python interpreter used by extension.
- Install latest dbt in the selected python environment.
- See the list of installed dbt adapters and install new adapters.
- Install dbt packages.
You can create a new dbt project using Command Palette. Press F1 (or ⇧⌘P) to run Command Palette, type WizardForDbtCore(TM): Create dbt Project
and press Enter. You should choose new project location and then answer all questions. This will open the new project in a separate VS Code window.
You can install dbt packages by running WizardForDbtCore(TM).installDbtPackages
command or by using language status item menu. After selecting package name and version, the packages.yml
file will be updated automatically.
The extension works on MacOS, Linux, and Windows (for Windows, see the additional information in the Windows Support article). It supports the default location of dbt_project.yml
file. To customize the location of profiles.yml
file use WizardForDbtCore(TM).profilesDir
setting.
Prior to using the extension, you need to perform the following steps in the VS Code Terminal:
- Install your dbt Core adapter.
python3 -m pip install dbt-bigquery dbt-snowflake
- For Windows, install WSL and Ubuntu 20.04 as Administrator (this requires a computer restart)
wsl --install -d Ubuntu-20.04
- Create your dbt profile and add your credentials.
touch ~/.dbt/profiles.yml
- See dbt Labs’ BigQuery profile, Snowflake profile documentation for more guidance on how to populate this file.
- Open your dbt project in a new VS Code window.
- Check that the extension is operating by right-clicking in any .sql model file, and selecting
Wizard for dbt Core (TM) > Show query preview
.
The extension retrieves environment variables from multiple sources, in the following order:
- Shell Configuration Files: Reads default shell environment variables (.zshrc, .bashrc, etc).
- VS Code Platform-Specific Setting: Reads from the
terminal.integrated.env.<platform>
VS Code setting. - DBT Project .env File: Pulls from a
.env
file located in the root directory of your dbt project. - Python Environment File Setting: Reads the file specified in the
python.envFile
VS Code setting.
If you have found any bug, have an idea or suggestion on how to improve extension, please file an issue and provide the details here: Issues