-
Add dbt-twirl to your dbt project, adding the following to
packages.yml
in your dbt project root folder (create it if it does not exist already):packages: - git: https://github.com/twirldata/dbt-twirl.git revision: 0.0.1
-
Install it by running
dbt deps
. -
Use macro
twirl_ref
macro to reference Twirl tables, like this:{{ dbt_twirl.twirl_ref('<name of production database>', '<name of schema/dataset>', '<name of table>') }}
in place of Twirl tables that are inputs to your dbt models -
If you want your dbt deployment to use the same naming convention for dev tables as that Twirl uses (e.g. all dev tables in one dev schema/dataset, named like
dev_username.schema_name__table_name
/dev_username.dataset_name__table_name
), you can add the following macros to your project:In
macros/generate_alias_name.yml
:{% macro generate_alias_name(custom_alias_name=none, node=none) -%} {{ dbt_twirl.twirl_alias_name(custom_alias_name, node) }} {%- endmacro %}
In
macros/generate_schema_name.yml
:{% macro generate_schema_name(custom_schema_name, node) -%} {{ dbt_twirl.twirl_schema_name(custom_schema_name, node) }} {%- endmacro %}
-
Notifications
You must be signed in to change notification settings - Fork 0
twirldata/dbt-twirl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Packages 0
No packages published