UNPKG

rawsql-ts

Version:

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

25 lines (24 loc) 1.03 kB
import { DropSchemaStatement } from "../models/DDLStatements"; import { Lexeme } from "../models/Lexeme"; /** * Parses DROP SCHEMA statements. */ export declare class DropSchemaParser { /** * Parses a DROP SCHEMA statement from raw SQL and validates that the entire string is consumed. * @param sql - The SQL string to parse * @returns The parsed DropSchemaStatement * @throws Error if the SQL string contains unexpected trailing tokens or is malformed */ static parse(sql: string): DropSchemaStatement; /** * Parses a DROP SCHEMA statement from lexemes starting at the provided index. * @param lexemes - The lexeme stream that contains the statement * @param index - The position within the lexeme stream where DROP SCHEMA should begin * @returns An object containing the parsed DropSchemaStatement and the new lexeme index */ static parseFromLexeme(lexemes: Lexeme[], index: number): { value: DropSchemaStatement; newIndex: number; }; }