import { StorageStrategy, QueryMatcher } from './storage-strategy'; interface DurableObjectSqlStorage { exec(query: string): { results: T[]; }; prepare(query: string): { bind(...values: any[]): { run(): void; all(): { results: T[]; }; first(): T | null; }; }; } interface DurableObjectState { storage: { sql: DurableObjectSqlStorage; }; blockConcurrencyWhile(callback: () => Promise): void; } /** * Durable Object SQL Storage Strategy * * Uses Cloudflare Durable Objects' SQL API for persistence. * Much faster than KV for bulk operations! * * Still loads all documents into memory for synchronous access, * but initial load is MUCH faster with SQL SELECT. */ export declare class DurableObjectSqlStorageStrategy implements StorageStrategy { private modelName; private ctx; private indexes; private initialized; private _data; lastOperationTime: number; constructor(ctx: DurableObjectState, modelName: string); /** * Initialize storage - creates tables and loads all documents */ initialize(): Promise; getAll(): Promise; add(doc: T): Promise; addMany(docs: T[]): Promise; update(oldDoc: T, newDoc: T): Promise; remove(doc: T): Promise; removeMany(docs: T[]): Promise; clear(): Promise; createIndex(fields: keyof T | Array, options?: { unique?: boolean; }): Promise; checkUniqueConstraints(doc: Partial, excludeDoc?: T): void; findDocuments(matcher: QueryMatcher, indexHint?: { fields: Array; values: Record; }): T[]; rebuildIndexes(): Promise; updateIndexForDocument(oldDoc: T | null, newDoc: T | null): void; } export {}; //# sourceMappingURL=durable-object-sql-strategy.d.ts.map