# `Hephaestus.Runtime.Storage.ETS`
[🔗](https://github.com/hephaestus-org/hephaestus_core/blob/v0.3.1/lib/hephaestus/runtime/storage/ets.ex#L1)

ETS-backed storage adapter for workflow instances.

# `filters`

```elixir
@type filters() :: keyword()
```

# `server`

```elixir
@type server() :: GenServer.server()
```

# `state`

```elixir
@type state() :: %{table: atom()}
```

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `delete`

```elixir
@spec delete(String.t()) :: :ok
```

Deletes a workflow instance by ID from the default ETS server.

Removes the entry from the ETS table via `:ets.delete/2`. The operation is
idempotent — deleting a non-existent instance is not an error.

# `delete`

```elixir
@spec delete(server(), String.t()) :: :ok
```

Deletes a workflow instance by ID from the given `server`.

# `get`

```elixir
@spec get(String.t()) :: {:ok, Hephaestus.Core.Instance.t()} | {:error, :not_found}
```

Retrieves a workflow instance by ID from the default ETS server.

Looks up the instance in the named ETS table via a `GenServer.call/2`.
Returns `{:ok, instance}` if found, or `{:error, :not_found}` otherwise.

# `get`

```elixir
@spec get(server(), String.t()) ::
  {:ok, Hephaestus.Core.Instance.t()} | {:error, :not_found}
```

Retrieves a workflow instance by ID from the given `server`.

# `put`

```elixir
@spec put(Hephaestus.Core.Instance.t()) :: :ok
```

Persists a workflow instance in the default ETS server.

Inserts or overwrites the instance keyed by its ID using `:ets.insert/2`.

# `put`

```elixir
@spec put(server(), Hephaestus.Core.Instance.t()) :: :ok
```

Persists a workflow instance in the given `server`.

# `query`

```elixir
@spec query(filters()) :: [Hephaestus.Core.Instance.t()]
```

Returns all workflow instances matching the given filters from the default ETS server.

Performs a full table scan with `:ets.tab2list/1` and filters in-memory by
`:status` and `:workflow` fields. An empty filter list returns all stored instances.

# `query`

```elixir
@spec query(server(), filters()) :: [Hephaestus.Core.Instance.t()]
```

Returns all workflow instances matching the given filters from the given `server`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the ETS storage process and links it to the caller.

## Options

  * `:name` - the registered process name (defaults to `Hephaestus.Runtime.Storage.ETS`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
