Bee.Repo (bee v0.3.0)

Copy Markdown View Source

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.

Summary

Functions

Returns a specification to start this module under a supervisor.

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).

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

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).