Skip to main content

Build from DBT

DBT is a powerful tool to transform your data, and VulcanSQL supports queries from DBT models directly. If you used DBT to create some models, you can make API for them instantly.

Installation

We need to install an additional package to integrate with DBT:

  1. Install package.

    npm i @vulcan-sql/extension-dbt
  2. Setup vulcan.yaml

    extensions:
    dbt: '@vulcan-sql/extension-dbt' # add this line
    dbt:
    modelFiles:
    - ./target/manifest.json # config the path to manifest.json
    info

    Manifest is an artifact which built from DBT cli, it should locate at “./target/manifest.json”

    info

    We are not able to share profiles with DBT yet, you need to config profiles for both VulcanSQL and DBT separately.

Using models in Vulcan

Using models of DBT is extremely easy, just use the following syntax for the table name.

{% dbt "model.<project-name>.<model-name>" %}

For example, to select all from model my_first_dbt_model in the project demo:

select * from {% dbt "model.demo.my_first_dbt_model" %}