pgsql-ast-parser
Advanced tools
Comparing version 1.3.2 to 1.3.3
{ | ||
"name": "pgsql-ast-parser", | ||
"version": "1.3.2", | ||
"version": "1.3.3", | ||
"description": "Yet another simple Postgres SQL parser/modifier", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
import { Statement, Expr } from './syntax/ast'; | ||
import { Statement, Expr, QName } from './syntax/ast'; | ||
/** Parse the first SQL statement in the given text (discards the rest), and return its AST */ | ||
@@ -7,3 +7,4 @@ export declare function parseFirst(sql: string): Statement; | ||
export declare function parse(sql: string, entry: 'expr'): Expr; | ||
export declare function parse(sql: string, entry: 'qualified_name'): QName; | ||
export declare function parseArrayLiteral(sql: string): string[]; | ||
//# sourceMappingURL=parser.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { Statement, Expr, LOCATION } from './syntax/ast'; | ||
import { Statement, Expr, LOCATION, QName } from './syntax/ast'; | ||
import { Parser, Grammar } from 'nearley'; | ||
@@ -18,2 +18,3 @@ import sqlGrammar from './syntax/main.ne'; | ||
export function parse(sql: string, entry: 'expr'): Expr; | ||
export function parse(sql: string, entry: 'qualified_name'): QName; | ||
export function parse(sql: string, entry?: string): any { | ||
@@ -20,0 +21,0 @@ if (!sqlCompiled) { |
@@ -740,2 +740,18 @@ import 'mocha'; | ||
}) | ||
checkTreeExpr([`pg_catalog.set_config('search_path', '', false)`], { | ||
type: 'call', | ||
function: 'set_config', | ||
namespace: 'pg_catalog', | ||
args: [{ | ||
type: 'string', | ||
value: 'search_path', | ||
}, { | ||
type: 'string', | ||
value: '', | ||
}, { | ||
type: 'boolean', | ||
value: false, | ||
}] | ||
}) | ||
}); | ||
@@ -742,0 +758,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
811187
8917