EctoHooks.Delta (ecto_hooks v1.1.0) View Source
Defines the struct which is given as the 2nd argument to any after_*
hooks.
Contains metadata which may be useful for introspecting or otherwise conditionally running hooks only when certain conditions are met.
The following information is present in an EctoHooks.Delta
:
- The
Ecto.Repo
callback that triggered the hook - The name of the current hook (useful if delegating to private functions in your schema)
- The
Ecto.Queryable
passed into the triggeringEcto.Repo
callback if any - The
Ecto.Changeset
passed into the triggeringEcto.Repo
callback if any
Link to this section Summary
Link to this section Types
Specs
hook() :: :before_update | :before_insert | :before_delete | :after_update | :after_insert | :after_get | :after_delete
Specs
repo_callback() :: :update | :update! | :preload | :reload | :reload! | :one | :one! | :insert_or_update | :insert_or_update! | :insert | :insert! | :get_by | :get_by! | :get | :get! | :delete | :delete! | :all
Specs
Link to this section Functions
Specs
new!(repo_callback(), hook(), source :: any()) :: t() | no_return()