View Source EctoHooks.Delta (ecto_hooks v1.2.1)
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.Repocallback that triggered the hook - The name of the current hook (useful if delegating to private functions in your schema)
- The
Ecto.Queryablepassed into the triggeringEcto.Repocallback if any - The
Ecto.Changesetpassed into the triggeringEcto.Repocallback if any
Summary
Types
@type hook() ::
:before_update
| :before_insert
| :before_delete
| :after_update
| :after_insert
| :after_get
| :after_delete
@type 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
Functions
@spec new!(repo_callback(), hook(), source :: any()) :: t() | no_return()