Studio Stores
Store bundle types, in-memory store, and optional SQLite session/trace store.
Import from @anvia/studio.
Store Bundle Types
type StudioStores = {
sessions?: StudioSessionStore | false;
traces?: StudioTraceStore;
pipelineLogs?: StudioPipelineLogStore | false;
pipelineRuns?: StudioPipelineRunStore | false;
};Purpose: optional persistence stores for Studio sessions, traces, pipeline logs, and pipeline run history.
Return behavior: false disables sessions, pipeline logs, or pipeline runs. Omitted traces disable trace routes unless the session store also implements StudioTraceStore. The default in-memory store implements session, trace, pipeline log, and pipeline run storage.
Notable errors: none directly.
In-Memory Store
function createInMemoryStudioStore(): StudioSessionStore &
StudioTraceStore &
StudioPipelineLogStore &
StudioPipelineRunStore;Purpose: create a process-local Studio store for sessions, traces, pipeline logs, and pipeline run history.
Return behavior: this is the default Studio store when no explicit store is provided.
Notable errors: none directly.
SQLite Store
type SqliteSessionStoreOptions = {
path?: string;
};
function createSqliteSessionStore(
options?: SqliteSessionStoreOptions,
): StudioSessionStore & StudioTraceStore & StudioPipelineLogStore & StudioPipelineRunStore;Purpose: create a SQLite-backed session, trace, pipeline log, and pipeline run store.
Return behavior: defaults to in-memory SQLite when path is omitted. When used with a file path, Studio creates dedicated anvia_studio_* tables.
Notable errors: throws when node:sqlite is unavailable, the database cannot open, or SQLite operations fail.
