Forge.Storage.ETS (Forge v0.1.1)

View Source

In-memory ETS-based storage backend.

Fast, queryable storage using Erlang Term Storage. Data is lost when the process terminates.

Options

  • :table - Table name (default: :forge_samples)
  • :type - Table type (default: :set, can be :ordered_set, :bag, :duplicate_bag)

Examples

# In pipeline config
storage Forge.Storage.ETS, table: :my_samples

# Manual usage
{:ok, state} = Forge.Storage.ETS.init(table: :test)
{:ok, state} = Forge.Storage.ETS.store(samples, state)
{:ok, sample, state} = Forge.Storage.ETS.retrieve("id-123", state)
{:ok, all, state} = Forge.Storage.ETS.list([], state)
:ok = Forge.Storage.ETS.cleanup(state)