Packages

The typed, attribute-queryable in-memory store for ETS and Mnesia. A simple ORM with record expiry (TTL), crash resilience, and atomic take-once reads.

Current section

Files

Jump to
active_memory lib adapters adapter.ex
Raw

lib/adapters/adapter.ex

defmodule ActiveMemory.Adapters.Adapter do
@moduledoc false
@callback all(atom()) :: list(map())
@callback create_table(atom()) :: :ok | {:error, any()}
@callback delete(map(), atom()) :: :ok | {:error, any()}
@callback delete_all(atom()) :: true | any()
@callback one(map(), atom()) :: {:ok, map()} | {:error, any()}
@callback one(list(any()), atom()) :: {:ok, map()} | {:error, any()}
@callback select(map(), atom()) :: {:ok, list(map())} | {:error, any()}
@callback select(list(any()), atom()) :: {:ok, list(map())} | {:error, any()}
@callback write(map(), atom()) :: {:ok, map()} | {:error, any()}
end