Caravela.Schema.Hook (Caravela v0.5.2)

Copy Markdown View Source

A lifecycle hook declared in the DSL via on_create, on_update, or on_delete.

The hook function itself is compiled into the domain module as a clause of __caravela_hook__/4. This struct is purely metadata so generators and compile-time validations can reason about which hooks exist.

Summary

Types

action()

@type action() :: :on_create | :on_update | :on_delete

t()

@type t() :: %Caravela.Schema.Hook{
  action: action(),
  arity: non_neg_integer(),
  entity: atom()
}