We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d910e3a commit c493f85Copy full SHA for c493f85
src/lib/Parser.ts
@@ -1,6 +1,6 @@
1
import prettier from 'prettier/standalone.js'
2
import SqlFormatter from 'prettier-plugin-sql'
3
-import { parse, deparse } from 'pgsql-parser'
+import { parse, Deparser } from 'pgsql-parser'
4
import { FormatterOptions } from './types.js'
5
6
const DEFAULT_FORMATTER_OPTIONS = {
@@ -33,9 +33,7 @@ interface ParseReturnValues {
33
*/
34
export function Deparse(parsedSql: object): DeparseReturnValues {
35
try {
36
- // @ts-ignore - Type definition defines non-optional any, though the argument is not required
37
- const data = deparse(parsedSql)
38
-
+ const data = new Deparser(parsedSql).deparseQuery()
39
return { data, error: null }
40
} catch (error) {
41
return { data: null, error: error as Error }
0 commit comments