What I want
const ledger = openLedger({ project: "test", inMemory: true });
Useful for:
- Unit tests that don't want to touch the filesystem.
- Sharing one in-memory ledger between an agent under test and Studio in the same process.
- CI environments where the default
~/.actantdb path doesn't exist or isn't writable.
Current state
openLedger requires a path. Tests work around this by writing to tempfile directories, which is fine until you want Studio to read the same in-memory store.
Implementation
node:sqlite supports :memory:. The Ledger constructor would need to:
- Accept
inMemory: true and skip the mkdirSync + path-derivation.
- Pass
:memory: to new DatabaseSync(":memory:").
- The same in-process
Ledger instance is safe to share; cross-process in-memory sharing isn't.
What I want
Useful for:
~/.actantdbpath doesn't exist or isn't writable.Current state
openLedgerrequires a path. Tests work around this by writing totempfiledirectories, which is fine until you want Studio to read the same in-memory store.Implementation
node:sqlitesupports:memory:. TheLedgerconstructor would need to:inMemory: trueand skip themkdirSync+ path-derivation.:memory:tonew DatabaseSync(":memory:").Ledgerinstance is safe to share; cross-process in-memory sharing isn't.