AutomateDV Documentation

repository·master·Indexed 20 days ago

https://github.com/datavault-uk/automate-dv

A dbt package that automates the generation and execution of ETL code for building a Data Vault 2.0 Data Warehouse. It allows data modelers to generate ETL from mapping metadata using template macros for hubs and other models. Compatible with dbt versions >= 1.9.x and <= 3.0.0, including dbt Fusion.

Tokens
508
Snippets
1
Records
3
Agent score
20%

What's inside AutomateDV

  1. How to use AutomateDV to build models

    master

    To implement Data Vault logic using AutomateDV, you follow a three-step pattern within your dbt model files:

    1. Configure the model: Use the standard dbt config() block.
    2. 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.
    3. 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) }}