EctoHooks.Delta (ecto_hooks v1.0.1) View Source

Struct which is given as the 2nd argument to any after_* hook defined by EctoHooks.

Contains metadata about the hook such as the particular Repo call which resulted in the hook being triggered, which hook was triggered, the source changeset, queryable, or struct which was passed into said Repo call.

This can be particularly helpful for conditionally disabling or enabling hooks on a subset of triggers -- i.e. only when certain fields have changed in a given schema.

In future, it might be possible for users to mark annotate certain Repo operations to trigger hooks only for those annotated functions. This is the mechanism by which that would work.

Link to this section Summary

Link to this section Functions

Link to this function

new!(operation, hook, source)

View Source