To implement Data Vault logic using AutomateDV, you follow a three-step pattern within your dbt model files:
- Configure the model: Use the standard dbt
config() block. - Provide metadata: Define variables such as primary keys (
src_pk), natural keys (src_nk), load timestamps (src_ldts), and source information using Jinja set statements. - Call the macro: Invoke the appropriate AutomateDV template macro (e.g.,
automate_dv.hub) passing the required metadata arguments.
# Configure model
{{- config(...) -}}
# Provide metadata
{%- set src_pk = ... -%}
{%- set src_nk = ... -%}
{%- set src_ldts = ... -%}
{%- set src_source = ... -%}
{%- set source_model = ... -%}
# Call the macro
{{ automate_dv.hub(src_pk, src_nk, src_ldts,
src_source, source_model) }}