Skip to content

Commit 9bf3820

Browse files
committed
docs: update usage example to destructure parse result
1 parent a38738c commit 9bf3820

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ import { PgParser } from '@supabase/pg-parser';
3838
const parser = new PgParser(); // Defaults to latest version (17)
3939

4040
// Parse a SQL query
41-
const result = await parser.parse('SELECT * FROM users WHERE id = 1');
41+
const { tree } = await parser.parse('SELECT * FROM users WHERE id = 1');
4242

43-
console.log(result);
43+
console.log(tree);
4444

45-
// { tree: { version: 170004, stmts: [ ... ] } }
45+
// { version: 170004, stmts: [ ... ] }
4646
```
4747

4848
## API

0 commit comments

Comments
 (0)