File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change 1
1
import prettier from 'prettier/standalone.js'
2
2
import SqlFormatter from 'prettier-plugin-sql'
3
- import { parse , deparse } from 'pgsql-parser'
3
+ import { parse , deparse , Deparser } from 'pgsql-parser'
4
4
import { FormatterOptions } from './types.js'
5
5
6
6
const DEFAULT_FORMATTER_OPTIONS = {
@@ -33,9 +33,7 @@ interface ParseReturnValues {
33
33
*/
34
34
export function Deparse ( parsedSql : object ) : DeparseReturnValues {
35
35
try {
36
- // @ts -ignore - Type definition defines non-optional any, though the argument is not required
37
- const data = deparse ( parsedSql )
38
-
36
+ const data = new Deparser ( parsedSql ) . deparseQuery ( )
39
37
return { data, error : null }
40
38
} catch ( error ) {
41
39
return { data : null , error : error as Error }
You can’t perform that action at this time.
0 commit comments