Skip to content

Commit 7689818

Browse files
committed
Document acceptUnsupportedGrammar option
1 parent 204ac57 commit 7689818

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ Parses SQL string and returns the CST tree. Takes the following options:
196196
By default a query like `SELECT * FROM tbl WHERE id = ?` will result in parse error.
197197
To fix it, use `paramTypes: ["?"]` config option.
198198
- **filename**: `string` Name of the SQL file. This is only used for error-reporting.
199+
- **acceptUnsupportedGrammar**: `boolean` When enabled, code that would otherwise fail to parse,
200+
gets parsed as `unsupported_grammar_stmt` node. That will consume all text until the next semicolon.
201+
After the semicolon, parsing will resume as normal. This option is primarily intended as a workaround
202+
for using the parser with an SQL dialect that's not yet 100% supported.
199203

200204
When parsing fails with syntax error, it throws `FormattedSyntaxError` which contains a message like:
201205

0 commit comments

Comments
 (0)