News for hackers. Stuff that matters.
Re:What I Wish Someone Told Me About Postgres by TRiG_Ireland on Tuesday November 12, 2024 @02:38PM (#42118853)
VS Code does (did?) detect embedded SQL in PHP and correctly colour it, but only if it's on a single line. Any linebreaks and the colour is turned off. Also, if you're using prepared statements and have an @label, and that label is at the end of the string (so immediately followed by a closing quote), the SQL colouring continues into the rest of the PHP beyond the string. So it's important that single-line SQL statements ending in a @label be edited into multi-line statements to turn off the broken SQL colouring. Odd.
Re:What I Wish Someone Told Me About Postgres by munk-a on Tuesday November 12, 2024 @02:47PM (#42118956)
PHP strings tend to have better syntax highlighting with here/now docs (i.e. starting with `<<<TOKEN`). I've found SublimeText to have excellent SQL detection when using these tokens to delineate queries (and the syntax lends itself well to block strings anyways).