jackc / sqlfmt

SQL Formatter
Apache License 2.0
337 stars 24 forks source link

Parse error: syntax error on joins #7

Closed sosedoff closed 4 years ago

sosedoff commented 7 years ago

Hey @jackc, Found this project today, its pretty cool, was going to use it for pgweb sql formatting feature. I tested it on a few queries, it worked fine most of the time until i hit an error with this query:

select * from bookings left join users on users.id = bookings.user_id

If i take out left from the sql it works. Otherwise im getting 2017/09/03 14:32:12 parse error: syntax error at character 70 error. The original query in my test was quite large, so it was not clear exactly where the sqlfmt fails.

jackc commented 7 years ago

Sadly, my work on sqlfmt has been on an indefinite hiatus. Not sure when I'll get back to it. https://github.com/darold/pgFormatter could be a good alternative except that it is a perl script...