UNPKG

rawsql-ts

Version:

[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.

19 lines (18 loc) 853 B
import { InsertQuery } from "../models/InsertQuery"; /** * Utility to convert INSERT ... VALUES statements into INSERT ... SELECT UNION ALL form and vice versa. * Enables easier column-by-column comparison across multi-row inserts. */ export declare class InsertQuerySelectValuesConverter { /** * Converts an INSERT query that uses VALUES into an equivalent INSERT ... SELECT UNION ALL form. * The original InsertQuery remains untouched; the returned InsertQuery references cloned structures. */ static toSelectUnion(insertQuery: InsertQuery): InsertQuery; /** * Converts an INSERT query that leverages SELECT statements (with optional UNION ALL) * into an equivalent INSERT ... VALUES representation. */ static toValues(insertQuery: InsertQuery): InsertQuery; private static flattenSelectQueries; }