Search⌘ K
AI Features

Hooks

Explore how to create and apply hooks in dbt, including on-run-start, on-run-end, pre-hook, and post-hook types. Learn to automate SQL tasks around your models, improving pipeline flexibility and control.

What are hooks?

Hooks are simply additional SQL statements that dbt can run. This is useful when we want to run some statements that cannot be configured in a standard materialization.

There are four types of hooks:

  • on-run-start runs at the start of a dbt command.

  • on-run-end runs at the end of a dbt command.

  • pre-hook runs at the start of a model, seed, or snapshot. ...