/** * grammar.ts * * Contains all the grammar definitions, to be used by [@ikerin/rd-parse](https://github.com/ivank/rd-parse) to build the parser. * Types (and documentation about the grammar itself) would be located at [grammar.types.ts](./grammar.types.ts) */ import * as Tag from './grammar.types'; /** * Postgres sql {@link Parser} ([@ikerin/rd-parse](https://github.com/ivank/rd-parse)) * Parses an sql string into {@link Tag.AstTag} * * @throws ParserError on parse error * * Example: * * ```ts * import { parser } from '@ovotech/potygen'; * * const sql = `SELECT * FROM users`; * const { ast } = parser(sql); * * console.log(ast); * ``` */ export declare const parser: (text: string) => { ast: Tag.AstTag; comments: Tag.CommentTag[]; }; /** * Postgres sql {@link Parser} ([@ikerin/rd-parse](https://github.com/ivank/rd-parse)) * Parses an sql string into {@link Tag.AstTag} * Difference with {@link parser} is that it will not throw in an event of a parse error, * but will return the partial result. * * Example: * * ```ts * import { partialParser } from '@ovotech/potygen'; * * const sql = `SELECT * FROM users`; * const { ast } = partialParser(sql); * * console.log(ast); */ export declare const partialParser: (text: string) => { ast: Tag.AstTag; comments: Tag.CommentTag[]; };