Jens Christian Hillerup
07/27/2024, 8:37 PM.yml
with schemas etc. Seems that if I just drop my .sql
files in the models
folder the views are created. So far so good. I want to integrate it with Metabase, and it seems dbt-metabase
needs the models to be properly declared in the YaML files... But I wonder; why introduce this source of inconsistency? My `SELECT`s may very well not have the same schema as whatever I declare in models.yml
. To me the query should be enough declaration in itself, shouldn't it?Matt Menzenski
07/27/2024, 11:19 PMref
macro.
why introduce this source of inconsistency? My `SELECT`s may very well not have the same schema as whatever I declare inIf you use the.models.yml
ref
macro in your SQL models, there’s no inconsistency. You can define the schema just once (e.g., in your dbt_project.yml
file). This is a far better approach because it supports workflows like a developer using a differenct schema for local testing than for production - easy to configure that when it’s defined in just one place rather than being hardcoded in many.Jens Christian Hillerup
08/09/2024, 7:32 PM.sql
file SHOULD be the same as in models.yml
but as far as I can tell that's not enforced