/** * SqliteMemoryBackend — better-sqlite3 backed memory storage. * * Lives in src/store/ alongside SqliteSlopeStore. Uses the same * `.slope/slope.db` file but a dedicated `memories` table (added in * migration v8). Keeps the API sync via better-sqlite3 prepared statements. * * Migration: on first open, if a sibling `.slope/memories.json` exists and * the memories table is empty, contents are imported and the JSON file is * renamed to `.slope/memories.json.bak` so the original is preserved as a * one-time backup. */ import type { MemoryBackend } from '../core/memory-backend.js'; import type { Memory, MemoriesFile } from '../core/memory-types.js'; export declare class SqliteMemoryBackend implements MemoryBackend { readonly kind: "sqlite"; private db; private cwd; /** True after the importJsonIfPresent() pass has run for this instance. */ private importedJson; constructor(cwd: string, dbPath: string); /** * Idempotent: create the memories table if it doesn't exist. Independent * of the SqliteSlopeStore migration system so the backend can be used * standalone (tests, embedded use). The full migration is owned by * SqliteSlopeStore (v8). */ private ensureSchema; /** One-time migration from .slope/memories.json. Runs at most once per * backend instance and only if the table is currently empty. */ private importJsonIfPresent; private renameJsonBackup; private prepareInsert; load(): MemoriesFile; saveAll(data: MemoriesFile): void; add(memory: Memory): void; remove(id: string): boolean; update(id: string, fields: Partial>): Memory | null; getById(id: string): Memory | undefined; /** Close the underlying connection. Test/teardown helper. */ close(): void; } //# sourceMappingURL=sqlite-memory-backend.d.ts.map