Sublime Forum

Highlight partial SQL strings in PHP

#1

So we have to work on a fairly large PHP project with lots of SQL strings floating around.

It’s very nice when sublime recognizes the contents of a string as SQL and does syntax highlighting. But this only works of the strings starts with a very small set of keywords, like ‘SELECT’

It would be great if it could look for other keywords in any place of the string to assume it’s SQL, like ‘ORDER BY’ ‘UNION’ etc.
A lot of our queries are broken up into chunks so only a few are highlighted.

0 Likes

#2

+1 on this
The following keywords should also be added :

  • BEGIN TRANSACTION
  • END TRANSACTION
  • COMMIT TRANSACTION
  • DROP
0 Likes

#3

https://github.com/jbrooksuk/ImprovedSQL

Feel free to add more keywords :smile:

0 Likes