Overriding the database in the dbt_project file does not work
See original GitHub issueWhen I override the database to something different than the database configured in the profile, the CLI says it’s going to built into the override database, but it’s executed on the profile database.
Example profiles.xml:
datawarehouse:
target: development
outputs:
development:
type: sqlserver
driver: 'ODBC Driver 17 for SQL Server'
server: bisql
port: 1433
windows_login: True
database: Test
schema: test
threads: 4
example dbt_project.yml:
...
models:
my_datawarehouse:
materialized: view
products:
+database: ProductsModels
+schema: ProductsModels
When ran, the CLI says “created view model ProductsModels.ProductsModels.Metrics…” but in reality it’s created in Test.ProductsModels.Metrics
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:21
Top Results From Across the Web
Custom databases - dbt Developer Hub
To override dbt's database name generation, create a macro named generate_database_name in your own dbt project. The generate_database_name ...
Read more >Deploy to custom schemas & override dbt defaults - YouTube
By default, all dbt models are built in the target schema specified in your profiles.yml file. In dbt projects with a lot of...
Read more >dbt depends on a source not found - Stack Overflow
This is due to the automate.metrics table missing from the database (either the dbt project's target database or a different database on the ......
Read more >Anatomy of a dbt project - Towards Data Science
For analysts not from a technical background, working with dbt can be ... This file contains the database connection that dbt will use...
Read more >dbt Guide - GitLab
dbt, short for data build tool, is an open source project for managing data ... There is no need to restart the container...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah, sorry… I changed the materialization to table so it’s obviously using sqlserver__create_table_as now.
I’m all for an adventure! 😃 And I’m also happy to wait to next week.
I added a file called sqlserver_create_view_as.sql in my macros folder with this as content:
But I have the impression it’s not using it at all, because it’s not logging the “THIS IS A TEST” anywhere. Or maybe I did not understand you?