You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom schemas are supported, but not custom databases (only partially with the prod_database_replace feature).
In our project, we write and read to and from different databases. This setup is currently not possible with upstream_prod (a model fails when it selects models from different databases).
We've added support for this by copying the solution for custom schemas.
Adding the macro get_custom_database.sql:
{% macro generate_database_name(custom_database_name=none, node=none, is_upstream_prod=False) -%}
{%- set default_database = target.database -%}
{%- if (target.name in ('prod') or is_upstream_prod == true) and custom_database_name is not none -%}
{{ custom_database_name | trim }}
{%- else -%}
{{ default_database }}
{%- endif -%}
{%- endmacro %}
Adding this to the upstream_prod.ref macro:
{% set custom_database_name = parent_node.config.database %}
{% set parent_database = generate_database_name(custom_database_name, parent_node, True) | trim %}
It would be cool if upstream_prod supports this out-of-the-box 🙂
The text was updated successfully, but these errors were encountered:
Custom schemas are supported, but not custom databases (only partially with the
prod_database_replace
feature).In our project, we write and read to and from different databases. This setup is currently not possible with
upstream_prod
(a model fails when it selects models from different databases).We've added support for this by copying the solution for custom schemas.
get_custom_database.sql
:upstream_prod.ref
macro:It would be cool if
upstream_prod
supports this out-of-the-box 🙂The text was updated successfully, but these errors were encountered: