import type { SelectRewriteContext, SelectRewriteResult, SelectRewriterOptions } from '../types'; /** * Rewrites SELECT statements by injecting fixture CTEs so tests can run without physical tables. */ export declare class SelectFixtureRewriter { private readonly fixtureStore; private readonly analyzer; private readonly logger; private readonly missingFixtureStrategy; private readonly passthrough; private readonly wildcardPassthrough; private readonly formatterOptions; private readonly cteConflictBehavior; private readonly analyzerFailureBehavior; private readonly tableNameResolver?; private readonly viewDefinitions; constructor(options?: SelectRewriterOptions); /** * Rewrites the provided SQL text, applying fixtures and formatting the final query. * @param sql - Original SQL that may include multiple statements. * @param context - Optional rewrite customization hooks. */ rewrite(sql: string, context?: SelectRewriteContext): SelectRewriteResult; private rewriteSingleQuery; private resolveAnalyzerFailureBehavior; /** * Skips statements that are clearly DCL (Data Control Language). * In theory, this should be detected via AST analysis, * but since DCL is outside the supported syntax scope of this library, * we use a lightweight prefix check as a simple safeguard. * * @param {string} sql - The SQL text to inspect. * @returns {boolean} True if the statement appears to be a DCL statement; otherwise, false. */ private isDclStatement; /** * Detects SELECT-style statements that must not fall back to regex injection when analysis fails. * This keeps source rewrites and alias planning on the AST path for queries that need structural handling. */ private isSelectStyleStatement; private isPassthrough; private handleMissingFixture; private mergeWithClause; private mergeWithClauseAst; private mergeWithClauseFallback; private promoteFixtureCtes; private resolveFixtureKey; private rewriteViewCteReferences; private ensureTerminated; private createFormatter; }