Extending
Extending dbtvault¶
This page describes how write your own macros to replace existing macros provided in dbtvault.
adapter.dispatch¶
Every macro in dbtvault first calls adapter.dispatch to find platform specific implementations of the macro to execute.
Here is an example:
1 2 3 4 5 6 7 |
|
This snippet defines the macro namespace as 'dbtvault'
, ensuring that this macro gets found in the list of macros implemented in the dbtvault package namespace.
To override the hub
macro and ensure dbt uses your own implementation of it, you simply need to provide a configuration in your dbt_project.yml
as follows:
1 2 3 4 5 6 7 8 |
|
With this configuration change, an implementation of the hub
macro could be defined in your own project as follows:
1 2 3 4 5 |
|
...and that's it! Yay!
Please ensure you read the adapter.dispatch and dispatch config docs for more details.