Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.
This repository was archived by the owner on May 17, 2024. It is now read-only.

Advanced custom schemas (dynamic schema behavior based on target) #447

Closed
@dlawin

Description

@dlawin

Is your feature request related to a problem? Please describe.
It's fairly common to override the generate_schema_name macro to control schema names per environment.

For example, you may override it so that you use a single schema for local development, but models write to multiple schema when env == 'prod':

Single local dev schema (<target_schema>)

  • dan_dev

Prod schemas (<custom_schema>)

  • marketing
  • sales
  • etc

This differs from the default behavior of dbt, where schema names are constructed as <target_schema>_<custom_schema>

Describe the solution you'd like
Ideally this is configurable

Maybe something like:
datadiff:
prod_schema: <custom_schema> <---- makes it dynamic. <custom_schema> if exists, otherwise <prod_schema>

Or similarly easy way to configure

https://docs.getdbt.com/docs/build/custom-schemas#changing-the-way-dbt-generates-a-schema-name

Alternatives considered:
Outside of configuration values, we would need a copy of the production manifest.json

Metadata

Metadata

Assignees

Labels

--dbtIssues/features related to the dbt integrationenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions