nene / sql-parser-cst

Parses SQL into Concrete Syntax Tree (CST)
GNU General Public License v2.0
115 stars 7 forks source link

SQLite replace() function causes a syntax error #53

Closed nene closed 4 months ago

nene commented 4 months ago

The following SQL:

SELECT replace('hello-world', '-', ' ');

Fails to parse with an error:

Syntax Error: Unexpected "replace"
Was expecting to see: "!", "$", "(", "*", "+", "-", ":", "?", "@", "ALL", "CASE", "CAST", "CURRENT_CATALOG", "CURRENT_DATE", "CURRENT_DATETIME", "CURRENT_ROLE", "CURRENT_SCHEMA", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "DATE", "DATETIME", "DISTINCT", "DISTINCTROW", "EXISTS", "FALSE", "LOCALTIME", "LOCALTIMESTAMP", "NOT", "NULL", "RAISE", "SAFE_CAST", "SESSION_USER", "SYSTEM_USER", "TIME", "TIMESTAMP", "TRUE", "USER", "X", "~", identifier, number, string, or whitespace
--> undefined:1:8
  |
1 | SELECT replace('hello-world', '-', ' ');
  |        ^