# `Slither.Store.Server`
[🔗](https://github.com/nshkrdotcom/slither/blob/v0.1.0/lib/slither/store/server.ex#L1)

GenServer owning ETS tables for a Store implementation.

Tables are `:protected` — any BEAM process can read directly via ETS,
but only this GenServer can write. This gives lock-free concurrent
reads with serialized write consistency.

# `bulk_insert`

```elixir
@spec bulk_insert(GenServer.server(), atom(), Enumerable.t()) :: :ok
```

Bulk insert an enumerable of records into a table. Serialized.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `delete`

```elixir
@spec delete(GenServer.server(), atom(), term()) :: :ok
```

Delete a key from a table. Serialized.

# `fold`

```elixir
@spec fold(module(), atom(), acc, (tuple(), acc -&gt; acc)) :: acc when acc: term()
```

Fold over all entries in a table. Lock-free.

# `get`

```elixir
@spec get(module(), atom(), term()) :: term() | nil
```

Read a value from a store's table. Lock-free, no GenServer call.

# `get!`

```elixir
@spec get!(module(), atom(), term()) :: term()
```

Read a value, raising if not found.

# `match`

```elixir
@spec match(module(), atom(), term()) :: [tuple()]
```

Match objects in a table. Lock-free.

# `put`

```elixir
@spec put(GenServer.server(), atom(), term(), term()) :: :ok
```

Insert a key-value pair into a table. Serialized.

# `reload`

```elixir
@spec reload(GenServer.server()) :: :ok | {:error, term()}
```

Reload all tables by re-running the store's `load/1` callback.
Creates new tables, loads data, then atomically swaps pointers.

# `select`

```elixir
@spec select(module(), atom(), :ets.match_spec()) :: [term()]
```

Select from a table using a match spec. Lock-free.

# `size`

```elixir
@spec size(module(), atom()) :: non_neg_integer()
```

Get the number of entries in a table. Lock-free.

# `start_link`

# `update`

```elixir
@spec update(GenServer.server(), atom(), term(), (term() -&gt; term())) ::
  {:ok, term()} | {:error, :not_found}
```

Atomically read-modify-write a value. Serialized.

---

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