4 ms·
Looks really cool, but I have one suggestion. Have you considered using leading commas? It makes big SQL statements much easier to edit and it improves diffs. I
by JelteF 8y ago
Looks really cool, but I have one suggestion. Have you considered using leading commas? It makes big SQL statements much easier to edit and it improves diffs. I normally use trailing commas for my code, but most sql dialects don't support it so I fallback to leading ones there.
- cabaalis 8y agoI believe and direct my team to use leading commas, with fields on individual lines, to facilitate easier copy/paste and also to make it easier to comment out sections of the query. It does lead to longer queries and poor use of screen real estate, but it is very readable.
- just_myles 8y agoFor really complex queries it can be totally confusing. At least for me it does. I prefer indentation. I like my SQL blocky.
- orthecreedence 8y agoOh god, no. No leading commas, anywhere. Not in javascript, not in SQL. It's like nails on a chalkboard. Funny because I was reading other people's comments and thinking "wow, that person is VERY opinionated on query formatting" (but now here I am).
- stubish 8y ago> Funny because I was reading other people's comments and thinking "wow, that person is VERY opinionated on query formatting" (but now here I am). There are opinions, and there are crimes against humanity (although that is a matter of opinion).