Live data from Hacker News

PgFormatter: A PostgreSQL SQL syntax beautifier

github.com

31–33 of 33 posts

Re: PgFormatter: A PostgreSQL SQL syntax beautifier

#31

I've never heard of a code formatter called a "syntax beautifier" before. The phrase "syntax beautifier" sounds more like a compiler plug-in that actually changes the language syntax to something more beautiful.

I think the beautifier part refers to it applying syntax highlighting to the web output.

Re: PgFormatter: A PostgreSQL SQL syntax beautifier

#32

Do we need to use caps for SQL keywords? My understanding is that it served a purpose back in the days of monochrome screens, but modern IDEs colour the keywords so caps are now redundant. Though I don't use caps even without colouring, I find them just a nuisance.

I prefer them because they make grepping for SQL code easier. Also syntax coloring inside strings is not common.

Re: PgFormatter: A PostgreSQL SQL syntax beautifier

#33

Do we need to use caps for SQL keywords? My understanding is that it served a purpose back in the days of monochrome screens, but modern IDEs colour the keywords so caps are now redundant. Though I don't use caps even without colouring, I find them just a nuisance.

No, not at all. SQL is case agnostic unless you're talking about field collations or, in many systems, object names. It's also largely whitespace agnostic. Many RDBMSs will handle this just fine: select*from"MyTable"where"column"=3

Ah, the whitespace agnostic didn't even occur to me!
Post reply on HN