Advanced custom schemas (dynamic schema behavior based on target) #447
Description
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