@memoflowio/memoflow-sdk-embedded
v0.2.0
Published
Native SQLite adapter for the memoflow TypeScript SDK
Readme
@memoflowio/memoflow-sdk-embedded
Native, single-process SQLite adapter for MemoFlow. Install this package only when the application
owns a local data directory and accepts the native platform binary. Remote clients and workers use
@memoflowio/memoflow-sdk, which has no native runtime dependency.
import { EmbeddedRuntimeError, WorkerLite } from '@memoflowio/memoflow-sdk-embedded';
const worker = new WorkerLite({
dataDir: './memoflow-data',
durabilityProfile: 'strict',
maxConcurrentWorkflows: 100,
});
console.log(worker.capabilities());Runs beyond maxConcurrentWorkflows remain durable in SQLite and wait in FIFO admission order.
capabilities() reports supported and unsupported behavior explicitly; notably, embedded mode does
not currently support workflow fork, output streaming, or the Postgres transactional-step feature.
Embedded boundary failures use EmbeddedRuntimeError, with the same code, retryable, scope,
and versioned detail shape used by normalized remote errors.
Verified SQLite backups are published online with their manifest made visible last. Restore is an offline operation and must run before constructing the destination worker:
await worker.backup('./backup.sqlite3', './backup.manifest.json');
worker.shutdown();
await WorkerLite.restoreBackup(
'./backup.sqlite3',
'./backup.manifest.json',
'./restored-memoflow-data',
);