/** * SqliteStorageAdapter * * Adapts the synchronous {@link SqliteKvStore} to the async `StorageAdapter` * contract from `@frontmcp/utils`, so SQLite can be used anywhere a * StorageAdapter is expected (e.g. `StorageTokenStore`, `StorageAuthorizationVault`, * and the auth token-storage factory). * * Extends `BaseStorageAdapter` to inherit the batch (`mget`/`mset`/`mdelete`), * `count`, and "pub/sub not supported" defaults. Only the SQLite-specific core * is implemented here. * * Notes: * - Every operation runs on the connection this process shares for the file, in call * order. One that reads and then writes (conditional set, incr, compare-and-act) runs * in a single `BEGIN IMMEDIATE` transaction, so it is atomic across processes too. * - Waiting for another process's lock does not block the event loop (see `SqliteConnection`). * - Pub/sub is NOT supported. Callers needing pub/sub must use Redis/Upstash. */ import { BaseStorageAdapter, type SetOptions } from '@frontmcp/utils'; import { SqliteKvStore } from './sqlite-kv.store'; import { type SqliteStorageOptions } from './sqlite.options'; export declare class SqliteStorageAdapter extends BaseStorageAdapter { protected readonly backendName = "sqlite"; private readonly kv; private readonly connection; /** * Whether this adapter created (and therefore owns the lifecycle of) `kv`. * When the store is passed in by the caller, closing it is the caller's * responsibility — `disconnect()` must not pull the rug out from under it. */ private readonly ownsKvStore; constructor(options: SqliteStorageOptions | SqliteKvStore); connect(): Promise; disconnect(): Promise; ping(): Promise; get(key: string): Promise; protected doSet(key: string, value: string, options?: SetOptions): Promise; delete(key: string): Promise; deleteIfEquals(key: string, expectedValue: string): Promise; expireIfEquals(key: string, expectedValue: string, ttlSeconds: number): Promise; setIfEquals(key: string, expectedValue: string, value: string): Promise; /** SQLite's `PRAGMA data_version` on this process's connection: it changes when another process commits. */ dataVersion(): Promise; exists(key: string): Promise; expire(key: string, ttlSeconds: number): Promise; ttl(key: string): Promise; keys(pattern?: string): Promise; incr(key: string): Promise; decr(key: string): Promise; incrBy(key: string, amount: number): Promise; /** * Expose the underlying KV store (advanced use / tests). */ getKvStore(): SqliteKvStore; protected getPubSubSuggestion(): string; } //# sourceMappingURL=sqlite-storage.adapter.d.ts.map