The beauty of Lightdash is that we’re pretty well synced with your dbt project. So, in Lightdash, Tables actually come from dbt models that have been defined in your dbt project’s .yml
files.
schema.yml
filesschema.yml
files, the Lightdash CLI will automatically generate and sync your schema.yml
files.
Inside your dbt project, open a terminal and run this command to generate the schema.yml
file for a model calledmymodel
:
schema.yml
file to add any new columns that have appeared in the database.
schema.yml
files after dbt run
generate
command relies on your database schema to detect which columns are required, you’ll often want to run dbt run
before running generate
. You can combine dbt run
and lighdash generate
into one command which will run models and then regenerate theschema.yml
files for any models than changed:
schema.yml
for multiple modelslightdash generate
supports dbt model selection syntax to generate files for a group of models:
product_category
that’s used a bunch of times throughout my project, I can create a doc block for this field:
product_category
(in Lightdash and in your dbt documentation) will become the doc block I’ve written above.
product_sales
model that looked like this:
product_sales.yml
file would be updated to include the doc block for product_category
: