import type { Database } from 'better-sqlite3'; import { KVStore, KVStoreTransaction, ScanOptions } from '../types.js'; import { Tuple } from '../codec.js'; /** * Performance notes: * - WITHOUT ROWID makes our range scans pretty fast in SQLite * - With large data / scans, the bottleneck becomes getting data into javascript in the correct format * - stmt.pluck(true) the `value` column in the scan query (if you dont need the key value) to just get a string array right off the bat * - patch better-sqlite3 to parse JSON values directly (seems possible, could add some api to know which strings should be parsed that way) * - Saves us the cost of SQLite -> string -> JSON.parse() */ export declare class SQLiteKVStore implements KVStore { private db; prefix: Tuple; private getStatement; private setStatement; private deleteStatement; private deleteRangeStatement; private scanStatement; private countStatement; private writeFactsQuery; constructor(db: Database, prefix?: Tuple); get(key: Tuple, prefix?: Tuple): any; set(key: Tuple, value: any, prefix?: Tuple): Promise; delete(key: Tuple, prefix?: Tuple): Promise; scan(options: ScanOptions): AsyncIterable<[Tuple, any]>; count(prefix: Tuple): Promise; clear(): Promise; scope(prefix: Tuple): KVStore; transact(): KVStoreTransaction; applyEdits(sets: AsyncIterable<[Tuple, any]> | Iterable<[Tuple, any]>, deletes: AsyncIterable | Iterable): Promise; }