From a40e111839588d9646c31eb26af9db29b19c7c49 Mon Sep 17 00:00:00 2001
From: Doug Beatty <44704949+dbeatty10@users.noreply.github.com>
Date: Fri, 23 Aug 2024 17:27:30 -0600
Subject: [PATCH] General examples of calling a macro in a hook
---
website/docs/docs/build/hooks-operations.md | 22 +++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/website/docs/docs/build/hooks-operations.md b/website/docs/docs/build/hooks-operations.md
index 9ed20291c34..db8532a0134 100644
--- a/website/docs/docs/build/hooks-operations.md
+++ b/website/docs/docs/build/hooks-operations.md
@@ -72,6 +72,28 @@ You can use hooks to provide database-specific functionality not available out-o
You can also use a [macro](/docs/build/jinja-macros#macros) to bundle up hook logic. Check out some of the examples in the reference sections for [on-run-start and on-run-end hooks](/reference/project-configs/on-run-start-on-run-end) and [pre- and post-hooks](/reference/resource-configs/pre-hook-post-hook).
+
+
+```sql
+{{ config(
+ pre_hook="{{ some_macro() }}"
+) }}
+
+select 1 as id
+```
+
+
+
+
+
+```sql
+models:
+ :
+ +pre-hook: "{{ some_macro() }}"
+```
+
+
+
## About operations
Operations are [macros](/docs/build/jinja-macros#macros) that you can run using the [`run-operation`](/reference/commands/run-operation) command. As such, operations aren't actually a separate resource in your dbt project — they are just a convenient way to invoke a macro without needing to run a model.