View Source Indexed.Managed.Helpers (Indexed v0.0.1)
Some tools for Indexed.Managed
.
Link to this section Summary
Functions
Given a preload function spec, create a preload function. key
is the key of
the parent entity which should be filled with the child or list of children.
Invoke fun with the managed state, finding it in the :managed key if needed. If fun returns a managed state and it was wrapped, rewrap it.
Link to this section Functions
@spec assoc_from_record(record(), atom()) :: record() | nil
@spec build_query(Indexed.Managed.t()) :: Ecto.Queryable.t()
@spec get_managed(state() | module(), atom()) :: Indexed.Managed.t()
Given a preload function spec, create a preload function. key
is the key of
the parent entity which should be filled with the child or list of children.
See t:preload/0
.
@spec with_state(Indexed.Managed.state_or_wrapped(), (state() -> any())) :: any()
Invoke fun with the managed state, finding it in the :managed key if needed. If fun returns a managed state and it was wrapped, rewrap it.