Skip to main content

lib/ecto/adapters/recall/meta.ex

defmodule Ecto.Adapters.Recall.Meta do
  @moduledoc false
  # The adapter_meta passed to every behaviour callback. Carries the repo plus
  # the Mnesia storage configuration resolved at `init/1`.

  @behaviour Access

  @type storage :: :ram_copies | :disc_copies | :disc_only_copies
  @type table_type :: :set | :ordered_set

  @type t :: %__MODULE__{
          repo: Ecto.Repo.t(),
          storage: storage,
          nodes: [node()],
          type: table_type
        }

  @enforce_keys [:repo]
  defstruct repo: nil, storage: :ram_copies, nodes: [node()], type: :ordered_set

  # Ecto reaches into adapter_meta with map access in a few places.
  defdelegate get(v, key, default), to: Map
  defdelegate fetch(v, key), to: Map
  defdelegate get_and_update(v, key, func), to: Map
  defdelegate pop(v, key), to: Map
end