import { Query, Sort } from "@peerbit/indexer-interface"; import { type DeferredPromise } from "p-defer"; type IndexColumn = { name: string; collation?: "NOCASE"; }; export interface QueryIndexPlanner { columnsToIndexes: Map boolean; creationPromiseDeferred: DeferredPromise; }[]; }>; } type StmtStats = Map; export declare const flattenQuery: (props?: { query: Query[]; sort?: Sort[] | Sort; }) => Generator<{ query: Query[]; sort?: Sort[] | Sort; } | undefined>; export declare class PlannableQuery { query: Query[]; sort: Sort[]; constructor(props: { query: Query[]; sort?: Sort[] | Sort; }); get key(): string; } export type PlanningSession = ReturnType; export declare class QueryPlanner { readonly props: { exec: (query: string) => Promise | any; /** * INDEXED BY is a hard SQLite requirement, not a hint. Keep the legacy * forced-index behavior by default and allow callers to disable it once * their query shapes have been verified against SQLite's own planner. */ forceIndexes?: boolean; optimizeAfterCreate?: boolean; }; stats: StmtStats; pendingIndexCreation: Map>; constructor(props: { exec: (query: string) => Promise | any; /** * INDEXED BY is a hard SQLite requirement, not a hint. Keep the legacy * forced-index behavior by default and allow callers to disable it once * their query shapes have been verified against SQLite's own planner. */ forceIndexes?: boolean; optimizeAfterCreate?: boolean; }); stop(): Promise; scope(query: PlannableQuery): { readonly forceIndex: boolean; beforePrepare: () => Promise; resolveIndex: (tableName: string, columns: string[]) => string; perform: (fn: () => Promise) => Promise; }; } export {}; //# sourceMappingURL=query-planner.d.ts.map