Closed mxmCherry closed 6 years ago
Yes, it only supports selects. And I think what is happening with "table" is it is considered a key word. Trying it with a different table name works.
$ echo 'SELECT * FROM foo' | sqlfmt
select
*
from
foo
Oh, right, did not think about that - makes sense, thank you.
Did
go get -u github.com/jackc/sqlfmt/cmd/sqlfmt
a few minutes ago and trying to run it:That's, umm, a bit surprising, as I'm quite used to write PG queries without quoting tables.
When you quote the table name - it works fine:
Seen this comment: https://github.com/jackc/sqlfmt/issues/7#issuecomment-326985548 so not actually expecting a fix (if it should be "fixed" at all?), just logging an issue.
Also, a bit of offtop question - it seems to support only SELECT statements, right? (as seen in
sql.y
file)