diff --git a/dbtlearn/macros/logging.sql b/dbtlearn/macros/logging.sql new file mode 100644 index 0000000..77783c7 --- /dev/null +++ b/dbtlearn/macros/logging.sql @@ -0,0 +1,6 @@ +{% macro learn_logging() %} + {{ log("Call your mom!") }} + {{ log("Call your dad!", info=True) }} --> Logs to the screen, too +-- {{ log("Call your dad!", info=True) }} --> This will be put to the screen + {% log("Call your dad!", info=True) %} --> This won't be executed +{% endmacro %} diff --git a/dbtlearn/macros/variables.sql b/dbtlearn/macros/variables.sql new file mode 100644 index 0000000..4ec4130 --- /dev/null +++ b/dbtlearn/macros/variables.sql @@ -0,0 +1,14 @@ +{% macro learn_variables() %} + + {% set your_name_jinja = "Zoltan" %} + {{ log("Hello " ~ your_name_jinja, info=True) }} + + {{ log("Hello dbt user " ~ var("user_name", "NO USERNAME IS SET!!") ~ "!", info=True) }} + + {% if var("in_test", False) %} + {{ log("In test", info=True) }} + {% else %} + {{ log("NOT in test", info=True) }} + {% endif %} + +{% endmacro %}