import { SqlStatement, Command, SqlParser, SqlCompiler, CommandExecutor, ExecutionResult, CursorResult, CursorOptions } from './interfaces'; import { Document, MongoClient } from 'mongodb'; import { SqlParserImpl } from './parser'; import { SqlCompilerImpl } from './compiler'; import { MongoExecutor } from './executor'; import { DummyMongoClient } from './executor/dummy-client'; /** * QueryLeaf: SQL to MongoDB query translator */ export declare class QueryLeaf { private parser; private compiler; private executor; /** * Create a new QueryLeaf instance with your MongoDB client * @param client Your MongoDB client * @param dbName Database name */ constructor(client: MongoClient, dbName: string); /** * Execute a SQL query on MongoDB and return documents * @param sql SQL query string * @returns Document results (no cursors) * @typeParam T - The type of documents that will be returned (defaults to Document) */ execute(sql: string): Promise>; /** * Execute a SQL query on MongoDB and return a cursor * @param sql SQL query string * @param options Options for cursor execution * @returns Cursor for SELECT queries, null for other queries * @typeParam T - The type of documents that will be returned (defaults to Document) */ executeCursor(sql: string, options?: CursorOptions): Promise>; /** * Parse a SQL query string * @param sql SQL query string * @returns Parsed SQL statement */ parse(sql: string): SqlStatement; /** * Compile a SQL statement to MongoDB commands * @param statement SQL statement * @returns MongoDB commands */ compile(statement: SqlStatement): Command[]; /** * Get the command executor instance * @returns Command executor */ getExecutor(): CommandExecutor; /** * No-op method for backward compatibility * QueryLeaf no longer manages MongoDB connections */ close(): Promise; } /** * Create a QueryLeaf instance with a dummy client for testing * No actual MongoDB connection is made */ export declare class DummyQueryLeaf extends QueryLeaf { /** * Create a new DummyQueryLeaf instance * @param dbName Database name */ constructor(dbName: string); } export { SqlStatement, Command, SqlParser, SqlCompiler, CommandExecutor, ExecutionResult, CursorResult, SqlParserImpl, SqlCompilerImpl, MongoExecutor, DummyMongoClient, }; export * from './interfaces';