-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Describe the bug
When I explicitly pass a database name in generate-sources (e.g. dbt-coves generate-sources --database <my_db_name>), that DB name isn't used / recognized in the {{database}} variable in config.yml.
To Reproduce
Steps to reproduce the behaviour:
- set up
sources_destinationusing the{{database}}variable in the path
e.g.sources_destination: "models/staging/{{database}}/{{database}}__{{schema}}/_{{schema}}__sources.yml" - run
dbt-coves generate-sources --database <my_db_name>
Expected behaviour
I expect my database name to be in the folder name of the generated sources.
Instead, the path dbt-coves creates is equivalent to models/staging/__{{schema}}/_{{schema}}__sources.yml
Desktop (please complete the following information):
- OS: macOS 15.3.2
- Version 1.9.0
Additional context
I've tried this with and without commenting the database variable at the top of sources. I've noticed this variable is also ignored. I think it'd be more intuitive to the user if {{database}} could come from either the CLI or config.yml, though for me personally, I just care about it coming from the CLI.
I also tried these variables:
{{ source_database }}(blank){{ relation.database }}(blank){{node.fqn[-3]}}(error:❌ 'node' is undefined)