DETS-backed persistence for the InMemory graph backend.
Stores nodes as {node_id, node_struct} records. Secondary indexes
are rebuilt on load via Graph.put_node/2.
Summary
Functions
Removes nodes by ID from DETS and strips any back-references to those IDs from every surviving node's link sets. Without the strip pass, surviving rows retain dangling references that re-materialize on reload.
Removes metadata entries by node ID from DETS.
Opens the DETS file at the configured path, returning a handle map.
Reads all records from DETS and rebuilds a Graph struct plus metadata map.
Persists changeset additions and links to DETS.
Persists metadata entries as {{:meta, id}, metadata} records.
Functions
Removes nodes by ID from DETS and strips any back-references to those IDs from every surviving node's link sets. Without the strip pass, surviving rows retain dangling references that re-materialize on reload.
Removes metadata entries by node ID from DETS.
Opens the DETS file at the configured path, returning a handle map.
@spec load(map()) :: {:ok, Mnemosyne.Graph.t(), map()} | {:error, term()}
Reads all records from DETS and rebuilds a Graph struct plus metadata map.
Node records are stored as {id, node} tuples, metadata records as
{{:meta, id}, metadata} tuples. Both are separated during the fold.
@spec save(Mnemosyne.Graph.Changeset.t(), map()) :: :ok | {:error, term()}
Persists changeset additions and links to DETS.
Persists metadata entries as {{:meta, id}, metadata} records.