rawsql-ts
Version:
[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
21 lines (20 loc) • 755 B
TypeScript
import { Lexeme } from "../models/Lexeme";
import { SelectQuery } from "../models/SelectQuery";
export declare class SelectQueryParser {
static parse(query: string): SelectQuery;
/**
* Asynchronously parse SQL string to AST.
* This method wraps the synchronous parse logic in a Promise for future extensibility.
* @param query SQL string to parse
* @returns Promise<SelectQuery>
*/
static parseAsync(query: string): Promise<SelectQuery>;
private static unionCommandSet;
private static selectCommandSet;
static parseFromLexeme(lexemes: Lexeme[], index: number): {
value: SelectQuery;
newIndex: number;
};
private static parseSimpleSelectQuery;
private static parseValuesQuery;
}