import { StorageStrategy, QueryMatcher } from './storage-strategy'; import type { Query, QueryOptions, Update } from '../model'; import type { AggregationPipeline } from '../aggregation'; export interface SqliteStorageOptions { dataPath: string; modelName: string; } /** * SQLite storage strategy with native SQL query execution * All queries, updates, and aggregations execute directly in SQLite * No in-memory data array - everything stored and queried in database */ export declare class SqliteStorageStrategy implements StorageStrategy { private _db; private _dataPath; private _modelName; private _dbFilePath; private _tableName; private _getDocId; private _initialized; private _pendingIndexes; private _queryBuilder; private _aggregationBuilder; private _uniqueIndexes; private _insertStmt?; private _deleteStmt?; private _selectAllStmt?; constructor(options: SqliteStorageOptions); initialize(): Promise; /** * Register custom SQLite functions for query operators */ private _registerCustomFunctions; /** * Execute query natively in SQLite - returns documents matching query */ queryNative(query: Query, options?: QueryOptions): Promise; /** * Execute update natively in SQLite - returns modified count */ updateNative(query: Query, update: Update): Promise<{ modifiedCount: number; }>; /** * Execute delete natively in SQLite - returns deleted count */ deleteNative(query: Query): Promise<{ deletedCount: number; }>; /** * Execute count natively in SQLite */ countNative(query: Query): Promise; /** * Execute aggregation natively in SQLite */ aggregateNative>(pipeline: AggregationPipeline): 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; drop(): Promise; /** * SQL-based unique constraint checking */ private _checkUniqueConstraintsSQL; createIndex(fields: keyof T | Array, options?: { unique?: boolean; }): Promise; rebuildIndexes(): Promise; updateIndexForDocument(_oldDoc: T | null, _newDoc: T | null): void; checkUniqueConstraints(_doc: Partial, _excludeDoc?: T): void; /** * Fallback method for findDocuments - only used if queryNative is not called * In practice, Model will detect queryNative and use that instead */ findDocuments(matcher: QueryMatcher, _indexHint?: { fields: Array; values: Record; }): Promise; /** * Record schema information in the _schema table * This is called automatically when a model is initialized */ recordSchema(schemaData: { modelName: string; version: string; definition: Record; indexes: Array<{ fields: string[]; unique: boolean; }>; options: Record; }): Promise; /** * Retrieve schema information for a model */ getSchema(modelName: string): Promise<{ modelName: string; version: string; definition: Record; indexes: Array<{ fields: string[]; unique: boolean; }>; options: Record; createdAt: Date; updatedAt: Date; } | null>; close(): void; } //# sourceMappingURL=sqlite-strategy.d.ts.map