0

I'm using SqLite Parser to parse my SQL to JSON. We are now using Google BQ and some SQL commands are failing in this parser, for example:

select EXTRACT(MONTH FROM DATE_SUB(CURRENT_DATE(), INTERVAL 1 MONTH))

This can be easily reproduced by using PEG online which generate this error on the above SQL

Line 1, column 15: Expected Semicolon or end of input but "(" found.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Tamir Klein
  • 3,514
  • 1
  • 20
  • 38
  • Can you provide a little more context into the problem? – Josh Voigts May 09 '18 at 19:04
  • If you go to PEG online and paste on the parser (left-hand side) the code from SqLite parser and the sql I provided in my example you will get an error. Looking for a way to update the parser to support this query. – Tamir Klein May 13 '18 at 12:05

1 Answers1

2

Try node-sql-parser.

It has bigquery.pegjs

xpt
  • 20,363
  • 37
  • 127
  • 216