4 ms·
Well it doesn't help that people continue using ALL CAPS for SQL keywords as a preferred style. In this century.
by misterdoubt 7y ago
Well it doesn't help that people continue using ALL CAPS for SQL keywords as a preferred style. In this century.
- zo1 7y agoI find that it helps differentiate the different components of the query. Same way we use all-caps for constants, etc. If it's lower-case, or camel-case, then it just sort of "melts" into the rest of the query.
- pletnes 7y agoNot with syntax highlighting.
- deleted 7y ago[deleted]
- preommr 7y agoThe tooling around sql is pretty awful. I was looking for a vscode plugin to get some syntax highlighting and linting for postgres yesterday, and just gave up. There are plenty of administrative tools that help with connecting to dbs and showing the results in a nice table, but nothing that really helps with writing it (or at least nothing of high quality that I could find).
- dewey 7y agohttps://www.jetbrains.com/datagrip/ https://www.jetbrains.com/datagrip/ and Postico are pretty great for PG I think. I'm using them every day and having the option to attach DataGrip to a directory of queries in your code and directly executing them from there with set variables is pretty sweet. It's helping you write queries by auto formatting and good auto completion.
- icebraining 7y agoAlso nice for differentiating it from the rest of non-SQL code.
- timrichard 7y agoOver the years, I must have annoyed various DBAs by saying "Is that a query, or a ransom note?"
- _jal 7y agoI so very wish this convention would die. Also, leading a new line with the comma.
- tmd83 7y agoI actually like them both a lot for someone who is a developer who has spend hours fixing/optimizing large queries. As someone mentioned in another comment good syntax highlighting is often not available for sql (if any) so having the keywords separated is very helpful. When fixing and improving things I mostly care about 10% of the query, the JOINS and WHERE clause and CAPS keyword make those much easier to grasp. And the comma at the line start is very helpful (even though it looks odd for me) when you are adding/removing columns and sections on the fly. If the comma is at the start of the line you can simply comment, if it's at line end you need to edit two lines when removing a particular line from the query.