UNPKG

rawsql-ts

Version:

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

24 lines (23 loc) 879 B
import { ExplainStatement } from "../models/DDLStatements"; import { Lexeme } from "../models/Lexeme"; import { SqlComponent } from "../models/SqlComponent"; type NestedStatementParser = (lexemes: Lexeme[], index: number) => { value: SqlComponent; newIndex: number; }; /** * Parses EXPLAIN statements including legacy shorthand flags and option lists. */ export declare class ExplainStatementParser { static parse(sql: string, parseNested: NestedStatementParser): ExplainStatement; static parseFromLexeme(lexemes: Lexeme[], index: number, parseNested: NestedStatementParser): { value: ExplainStatement; newIndex: number; }; private static parseOptionList; private static isLegacyFlag; private static canStartOptionName; private static extractAfterComments; private static attachTrailingCommentsToNextLexeme; } export {};