/** * MJ Placeholder Substitution * * Replaces MJ tokens (Nunjucks templates, composition refs) with SQL-safe * placeholders that node-sql-parser can parse correctly. Each placeholder * is typed to match the SQL context: * * - sqlString/sqlDate → string literal: '__MJT_001__' * - sqlNumber → numeric literal: 42001 * - sqlIdentifier → bare identifier: __MJI_001__ * - sqlIn → IN list: ('__MJT_001__') * - sqlBoolean → numeric literal: 1 * - composition ref → subquery alias: [__MJQ_001__] * * The position map allows later reconstruction of the original MJ SQL * from the AST by mapping placeholders back to their original tokens. */ import { PlaceholderSubstitutionResult } from './mj-ast-types.js'; /** * Substitutes MJ tokens in SQL with SQL-safe placeholders. */ export declare class MJPlaceholderSubstitution { private stringCounter; private numberCounter; private identifierCounter; private inListCounter; private compositionCounter; private booleanCounter; /** * Tokenize the SQL and replace all MJ tokens with SQL-safe placeholders. * * Block tags (if/elif/else/endif/for/endfor/set) are stripped entirely * (their body content is kept). Template expressions and composition refs * are replaced with typed placeholders. */ static Substitute(sql: string): PlaceholderSubstitutionResult; private substituteInternal; /** * Creates a SQL-safe placeholder for a template expression, * choosing the placeholder type based on the filter chain. */ private createExpressionPlaceholder; /** * Finds the primary SQL filter from the filter chain. * Looks for MJ-specific SQL filters, ignoring utility filters like 'default'. */ private findPrimarySQLFilter; private nextStringPlaceholder; private nextNumberPlaceholder; private nextIdentifierPlaceholder; private nextInListPlaceholder; private nextBooleanPlaceholder; private nextCompositionPlaceholder; } //# sourceMappingURL=mj-placeholder.d.ts.map