Located in the macros/ folder as .sql files.

You can hide preceding and trailing whitespaces of your macro using the following - syntax:

{% macro <macro-name>(<args>) -%}
...
{%- endmacro -%}

Once a macro is defined in macros/, it can immediately be used in a .sql file using {{ <macro-name>(...) }}.

Command

For some macros, you can run them individually using dbt run-operation <macro-name>