The dbt Extension
dbt is a powerful tool to transform your data, and VulcanSQL supports queries from dbt models directly. If you use dbt to create some models, you can make APIs for them instantly.
Installation
We need to install an additional package to integrate with dbt:
Install package(If you have VulcanSQL in the binary version, you can skip this step)
npm i @vulcan-sql/extension-dbt
Setup
vulcan.yaml
extensions:
dbt: '@vulcan-sql/extension-dbt' # add this line
dbt:
modelFiles:
- ./target/manifest.json # config the path to manifest.jsoninfoManifest is an artifact which is built from dbt cli, it should be located at “./target/manifest.json”
infoWe are not able to share profiles with dbt yet, you need to config profiles for both VulcanSQL and dbt separately.
Using models in VulcanSQL
Using models of dbt is extremely easy, you only need to use the following syntax.
{% dbt "model.<project-name>.<model-name>" %}
For example, to query all data from model my_first_dbt_model
in the project demo
:
select * from {% dbt "model.demo.my_first_dbt_model" %}