Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>dbt WizardNew to Visual Studio Code? Get it now.

dbt Wizard

Preview

Fivetran

|
574 installs
| (0) | Free
This extension will help you work with dbt
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

dbt Wizard

This extension will help you work with dbt. Also, it provides additional features like Highlighting errors, Completion for SQL, etc., for BigQuery data warehouses.

Note: Turning on Auto Save is strongly recommended. With this option turned on, VS Code will save your changes after a configured delay or when the focus leaves the editor. This feature is required for preview, completion, and error highlighting.

Table of Contents

  • Features
    • Go to definition
    • Highlighting errors
    • Signature help
    • Completion for SQL
    • Completion for dbt
    • dbt compile preview
    • Information on hover
  • How to use
  • Profiles
    • BigQuery Profile
      • oauth via gcloud
      • oauth token-based
      • service account file
      • service account json

Features

Feature Supported Adapters
Go to definition All
Highlighting errors BigQuery
Signature help All
Completion for SQL BigQuery
Completion for dbt All
Completion for dbt models BigQuery
dbt compile preview All
Information on hover BigQuery

Go to definition

Macros

Definition Macro

Models

Definition Ref

Sources

Definition Source

Highlighting errors

Highlighting errors

Signature help

Signature help

Completion for SQL

Completion for SQL

Completion for dbt

Macros

Completion for macros

Models

Completion for models

Sources

Completion for sources

dbt compile preview

dbt compile preview

Information on hover

Information on hover

How to use

The extension works on MacOS, Linux, and Windows (for Windows, see the additional steps in the Windows Support article). It supports the default locations for profiles.yml and dbt_project.yml files.

Prior to using the extension, you need to perform the following steps (note: replace dbt-bigquery with your adapter, such as dbt-postgres):

  1. Install bigquery-dbt and dbt-rpc (e.g., python3 -m pip install dbt-bigquery dbt-rpc).
  2. In Terminal, test that dbt-rpc works by running the dbt-rpc --version command or specifying the Python environment for VS Code that was used to install dbt (e.g., ~/dbt-env/bin/python3).
  3. Create a file named profiles.yml in the ~/.dbt/ folder and add a profile.
  4. Open the dbt project in the new VS Code window.
  5. Now you can open your model and see the dbt compile preview by right-clicking the code and choosing Show query preview from the context menu.

Profiles

You can use this extension with any data warehouse which is supported by dbt. See Available adapters.

BigQuery Profile

A BigQuery profile can be set up using one of the following authentication methods:

  • oauth via gcloud
  • oauth token-based
  • service account file
  • service account json

OAuth via gcloud

An example of /Users/user/.dbt/profiles.yml using the OAuth via gcloud authorization type:

my-bigquery-db:
  target: prod
  outputs:
    prod:
      type: bigquery
      method: oauth
      project: google-test-project-id-400
      dataset: dbt_default
      threads: 4

Oauth Token-Based

An example of /Users/user/.dbt/profiles.yml using the Oauth Token-Based authorization type:

Refresh token
my-bigquery-db:
  target: prod
  outputs:
    prod:
      type: bigquery
      method: oauth-secrets
      project: google-test-project-id-400
      dataset: dbt_default
      threads: 4
      refresh_token: [refresh token]
      client_id: [client id]
      client_secret: [client secret]
      token_uri: https://oauth2.googleapis.com/token
Temporary token
my-bigquery-db:
  target: prod
  outputs:
    prod:
      type: bigquery
      method: oauth-secrets
      project: google-test-project-id-400
      dataset: dbt_default
      threads: 4
      token: [temporary access token]

Service Account File

An example of /Users/user/.dbt/profiles.yml using the Service Account File authorization type:

my-bigquery-db:
  target: prod
  outputs:
    prod:
      type: bigquery
      method: service-account
      project: google-test-project-id-400
      keyfile: /Users/user/.dbt/google-test-project-id-400.json
      dataset: dbt_default
      threads: 4

Service Account JSON

An example of /Users/user/.dbt/profiles.yml using the Service Account JSON authorization type:

my-bigquery-db:
  target: prod
  outputs:
    prod:
      type: bigquery
      method: service-account-json
      project: google-test-project-id-400
      dataset: dbt_default
      threads: 4

      # These fields come from the service account json keyfile
      keyfile_json:
        type: service_account
        project_id: google-test-project-id-400
        private_key_id: ...
        private_key: |
          -----BEGIN PRIVATE KEY-----
          ...
          -----END PRIVATE KEY-----
        client_email: test-bigquery@google-test-project-id-400.iam.gserviceaccount.com
        client_id: ...
        auth_uri: https://accounts.google.com/o/oauth2/auth
        token_uri: https://oauth2.googleapis.com/token
        auth_provider_x509_cert_url: https://www.googleapis.com/oauth2/v1/certs
        client_x509_cert_url: https://www.googleapis.com/robot/v1/metadata/x509/test-bigquery%40google-test-project-id-400.iam.gserviceaccount.com

Issues

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

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft