elementary icon indicating copy to clipboard operation
elementary copied to clipboard

[Feature] Enable to specify destination database and schema for elementary

Open yu-iskw opened this issue 3 years ago • 1 comments

Motivation

The destination database and schema for elementary is settled by the first node whose package_name is elementary. If we have multiple databases and schemas with dbt tests by elementary in a dbt project, the destination can vary. So, it would be great to specify the destination database and schema.

  • https://github.com/elementary-data/dbt-data-reliability/blob/e1e7cf05cb631c4ce00542f833fc9dc2b083686f/macros/edr/dbt_artifacts/upload_dbt_artifacts.sql
  • https://github.com/elementary-data/dbt-data-reliability/blob/e1e7cf05cb631c4ce00542f833fc9dc2b083686f/macros/utils/graph/get_model_database_and_schema.sql

Possible behavior

Default

If destination database and schema are not specified, the detination database can be the database of a profile and the destination schema can be elementary by default.

  • https://docs.getdbt.com/reference/dbt-jinja-functions/target

Specified

If the destination database for elementary is specified with something like elementary_artifacts_database as a dbt variable, it is set. And if the destination schema is specified with something like elementary_artifacts_schema as a dbt variable, it is used.

yu-iskw avatar Jun 29 '22 08:06 yu-iskw

Thanks for opening it @yu-iskw ! see my comment in the original issue here

oravi avatar Jun 29 '22 10:06 oravi