/** * Nexus SQLite Recursive CTE Query DSL * * Provides a safe, parameterized interface for executing recursive CTEs * against nexus.db. Supports raw CTE syntax and 6 template aliases for * common code intelligence queries. * * Template aliases: * - callers-of : All functions that call a symbol * - callees-of : All functions called by a symbol * - co-changed : Symbols in same file_path history * - co-cited : Symbols referenced together in code * - path-between : Shortest call path between two symbols * - community-members : All symbols in a community * * @task T1057 * @epic T1042 */ import type { DatabaseSync } from 'node:sqlite'; import type { NexusCteAlias, NexusCteParams, NexusCtePlaceholder, NexusCteResult, NexusQueryCteResult } from '@cleocode/contracts'; import { type EngineResult } from '../engine-result.js'; export { getColdSymbols, getHotNodes, getHotPaths, type NexusColdSymbol, type NexusColdSymbolsResult, type NexusHotNode, type NexusHotNodesResult, type NexusHotPath, type NexusHotPathsResult, type NexusPlasticityResult, } from './plasticity-queries.js'; /** * Compile a named alias into a parameterized CTE placeholder. * Returns the CTE string and parameter information. * * @param alias - Template alias name * @returns Compiled CTE placeholder * @throws CleoError if alias is unknown */ export declare function compileCteAlias(alias: NexusCteAlias): NexusCtePlaceholder; /** * Execute a raw CTE query against nexus.db with parameter binding. * * Validates the CTE syntax before execution. Handles both raw CTEs and * parameterized queries. Returns structured result with rows and metadata. * * @param cte - SQL CTE string, may contain ? or :param placeholders * @param params - Positional parameter values (for ? placeholders) * @param db - Optional DatabaseSync instance (uses global nexus.db if omitted) * @returns NexusCteResult with rows and execution metadata * * @task T1057 * @throws Errors are caught and returned in result.error (not thrown) */ export declare function runNexusCte(cte: string, params: NexusCteParams, db?: DatabaseSync): Promise; /** * Convert query result rows to markdown table format. * Used by CLI to format output for human consumption. * * @param result - NexusCteResult from runNexusCte() * @returns Markdown table string */ export declare function formatCteResultAsMarkdown(result: NexusCteResult): string; export declare function nexusQueryCte(cte: string, params?: string[]): Promise>; //# sourceMappingURL=query-dsl.d.ts.map