/** * AST visitor to qualify unqualified column references in JOIN ON clauses. * * Stock Drizzle renders an aliased SQL field of a subquery or CTE by its bare * alias, so `eq(table.col, sq.col)` becomes `"table"."col" = "col"`, which * DuckDB rejects as ambiguous. Selects built by this driver already qualify * those fields (see exposeSubqueryFields), so this mostly covers raw SQL. The unqualified side is given to the newly joined * source unless the qualified side already is that source. When that cannot * be decided, the reference is left as it is. * * Other unqualified references to the same name in SELECT, WHERE, GROUP BY, * HAVING and ORDER BY get the qualifier chosen in the ON clause. Names that * were given different qualifiers, and USING columns, are left unqualified. * * Performance optimizations: * - Early exit when no unqualified columns found in ON clause * - Skip processing if all columns are already qualified * - Minimal tree traversal when possible */ import type { AST } from 'node-sql-parser'; export declare function qualifyJoinColumns(ast: AST | AST[]): boolean;