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.
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...
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:
If i take out
left
from the sql it works. Otherwise im getting2017/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.