Jido. Memory. Store behaviour
(Jido Memory v1.0.0)
View Source
Storage adapter behavior for memory persistence and retrieval.
jido_memory ships with ETS and Redis implementations, but callers only
depend on this behavior so they can migrate to other storage backends later
without API churn.
Summary
Functions
Fetches a single record and normalizes not-found semantics.
Normalizes store declarations into {module, opts} tuples.
Validates store-specific options when the store exports validate_options/1.
Types
Callbacks
@callback get(key(), opts()) :: {:ok, Jido.Memory.Record.t()} | :not_found | {:error, term()}
@callback prune_expired(opts()) :: {:ok, non_neg_integer()} | {:error, term()}
@callback put(Jido.Memory.Record.t(), opts()) :: {:ok, Jido.Memory.Record.t()} | {:error, term()}
@callback query(Jido.Memory.Query.t(), opts()) :: {:ok, [Jido.Memory.Record.t()]} | {:error, term()}
Functions
@spec fetch(module(), key(), opts()) :: {:ok, Jido.Memory.Record.t()} | {:error, term()}
Fetches a single record and normalizes not-found semantics.
Normalizes store declarations into {module, opts} tuples.
Validates store-specific options when the store exports validate_options/1.