# `Bee.Repo`
[🔗](https://github.com/fosferon/bee/blob/v0.3.0/lib/bee/repo.ex#L1)

The GenServer that owns the writer connection, the in-memory dependency and
allocation graphs, and the JSONL export. Backs the `Bee.*` module API.

Start it directly for tests or single-process use:

    {:ok, _pid} =
      Bee.Repo.start_link(db_path: db_path, prefix: "bee", jsonl_path: nil, name: :my_bee)

In a supervised application, prefer `Bee.Supervisor`, which also starts the
read-only connection pool and the lock sweeper.

`Bee.Repo` also exposes a versioned GenServer **message protocol** — the wire
contract for node-crossing consumers (`{:create, title, opts}`, `{:ready, opts}`,
...). It is a supported surface, equal to the `Bee.*` API; see the README's
"Two consumption surfaces" section.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

Starts the Repo GenServer. Options: `:db_path` (required), `:prefix`,
`:jsonl_path`, `:name`, and `:start_pool?` (default `true`; set `false` when
running under `Bee.Supervisor`, which owns the pool).

---

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