taozhi8833998 / node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL
https://taozhi8833998.github.io/node-sql-parser/
Apache License 2.0
798 stars 180 forks source link

[SQLite] - Doesn't seem to support EXISTS #1961

Closed hugonoro closed 3 months ago

hugonoro commented 3 months ago

Was trying to parse a query with the format

SELECT * from <table> WHERE NOT EXISTS (SELECT * FROM <table> WHERE <field> = <value> AND field = <value>)

and I'm getting the error

Expected "!=", "#", "%", "&&", "(", "*", "+", ",", "-", "--", ".", "/", "/*", ";", "<", "<=", "<>", "=", ">", ">=", "AND", "BETWEEN", "FOR", "GROUP", "HAVING", "IN", "IS", "LIKE", "LIMIT", "NOT", "OR", "ORDER", "REGEXP", "RLIKE", "UNION", "glob", "||", [ \t\n\r], or end of input but "E" found.

From the error it seems EXISTS is definitely not one of the expected expressions.

Would it be possible to support this?