rawsql-ts
Version:
[beta]High-performance SQL parser and AST analyzer written in TypeScript. Provides fast parsing and advanced transformation capabilities.
28 lines (27 loc) • 950 B
TypeScript
import { SelectClause, SelectItem } from "../models/Clause";
import { Lexeme } from "../models/Lexeme";
export declare class SelectClauseParser {
static parse(query: string): SelectClause;
static parseFromLexeme(lexemes: Lexeme[], index: number): {
value: SelectClause;
newIndex: number;
};
}
export declare class SelectItemParser {
/**
* Parses a single select item from a SQL string.
* @param query The SQL string representing a select item (e.g. 'id as user_id').
* @returns The parsed SelectItem instance.
*/
static parse(query: string): SelectItem;
/**
* Parses a single select item from lexemes.
* @param lexemes The array of lexemes.
* @param index The starting index.
* @returns An object containing the SelectItem and the new index.
*/
static parseItem(lexemes: Lexeme[], index: number): {
value: SelectItem;
newIndex: number;
};
}