Skip to content

Changing the database via {{ config(database='OTHER_DB') }} doesn't work #110

@panasenco

Description

@panasenco

My default database name is EDW_BDM but I'm trying to create this one view in a different database FI_DM_EBI.

sqlserver.sql:

{{ config(database='FI_DM_EBI') }}
SELECT
  'a' AS col1,
  'b' AS col2

dbt run prints START view model FI_DM_EBI.dbo.sqlserver and dbt docs show below database structure:

image

However, the view still gets created in EDW_BDM. Looking at debug output, the connection string used is the default one that has the database EDW_BDM.

The same thing happens when changing the database name in dbt_project.yml:

models:
  hopedw:
    example:
      database: FI_DM_EBI

Please add support for changing the database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions