SQL Sugar
Posted: 28 October 2008 06:47 AM   [ Ignore ]
Member
RankRankRank
Total Posts:  81
Joined  2008-10-28

I’ve been working on an SQL sugar. Here’s a screenshot of it colouring a database backup:
http://www.fileability.net/downloads/SQLSugar.png

I’ll upload the actual sugar later today when it’s a bit more polished.

EDIT:
Download the SQL sugar:
http://www.fileability.net/downloads/SQLSugar.zip

It needs to be put in ~/Library/Application Support/Espresso/Sugars/

Profile
 
 
Posted: 28 October 2008 07:23 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  12
Joined  2008-10-28

Seems to be a problem with that link but a SQL sugar is certainly going to be useful. Be very interested to see this one personally.

Profile
 
 
Posted: 28 October 2008 07:31 AM   [ Ignore ]   [ # 2 ]
Member
RankRankRank
Total Posts:  81
Joined  2008-10-28

Oh damn, screencast.com has gone down for some reason. Here’s another link (post updated):
http://www.fileability.net/downloads/SQLSugar.png

Profile
 
 
Posted: 28 October 2008 07:34 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  12
Joined  2008-10-28

Hey that one works. Very cool beans.

Profile
 
 
Posted: 28 October 2008 08:37 AM   [ Ignore ]   [ # 4 ]
Member
RankRankRank
Total Posts:  81
Joined  2008-10-28

OK, I think this is about ready enough for a first release. I need to add loads more keywords but it’s certainly useable at least.

Download the SQL sugar:
http://www.fileability.net/downloads/SQLSugar.zip

It needs to be put in ~/Library/Application Support/Espresso/Sugars/


EDIT: I’ve just noticed that I forget to change a few selectors ending in .js to .sql. Shouldn’t affect the usage of the sugar.

Profile
 
 
Posted: 02 November 2008 12:10 PM   [ Ignore ]   [ # 5 ]
Member
RankRankRank
Total Posts:  81
Joined  2008-10-28

Release 2

New:
  • Rewritten using XML
  • Now in bundle format
  • More keywords + functions + constants
  • Some basic codesense

Download: fileability.net/downloads/SQL2.zip

Profile
 
 
Posted: 26 November 2008 03:13 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  18
Joined  2008-11-19

This sugar is looking good.  Espresso is really starting to replace Textmate for me now.  One thing I’ve noticed is that inline in PHP, the SQL highlighting works fine for normal strings, but when I have a string encapsulated with ’<<<EOQ’ and ‘EOQ;’, no formatting occurs.

I’ve attached a screenshot showing a working and non-working example.

Image Attachments
Picture 2.png
Profile
 
 
Posted: 26 November 2008 03:40 AM   [ Ignore ]   [ # 7 ]
Member
RankRankRank
Total Posts:  81
Joined  2008-10-28

That’s a problem with the PHP sugar not supporting heredoc, not the SQL sugar.

Profile
 
 
Posted: 26 November 2008 03:41 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  18
Joined  2008-11-19

OK, I’ll re-post it there then.

Profile
 
 
Posted: 29 January 2010 10:48 AM   [ Ignore ]   [ # 9 ]
Newbie
Rank
Total Posts:  1
Joined  2010-01-29

Less Confusion - More info - Which one is the updated one? The one in the first post or the one further down.

... generally keep the first one the most updated?

Profile
 
 
Posted: 29 January 2010 12:19 PM   [ Ignore ]   [ # 10 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

Usually Sugar devs keep the link in the first post the most updated, but in this case I’d recommend just getting it from GitHub:

http://github.com/fileability/sql.sugar/

Since it doesn’t have any special compiled portions, you can just use GitHub’s project downloading, unzip it, rename the folder SQL.sugar if necessary, and install it.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile
 
 
Posted: 13 February 2010 03:21 PM   [ Ignore ]   [ # 11 ]
Newbie
Avatar
Rank
Total Posts:  12
Joined  2008-11-24

how would you setup syntax coloring for the following part of a mysql command inside a .php file:

mysql_query(“UPDATE table SET field1=’$value1’”)

OR

mysql_query(“UPDATE table SET field1=’$value1‘“)


Right now everything except ‘UPDATE’ is the same color and so syntax coloring perks don’t apply to the code :/

Profile
 
 
Posted: 13 February 2010 05:26 PM   [ Ignore ]   [ # 12 ]
Moderator
RankRankRankRank
Total Posts:  1252
Joined  2008-10-28

It depends; if the SQL already has syntax zones defined for it you might be able to just add some rules to your theme’s CSS in order to add coloring. If there aren’t zones defined, though, you’ll need to modify the SQL sugar to add them.

You can figure out if the zones are already there by choosing Actions->Show Syntax Inspector and sticking your cursor in the text that you want to see the syntax zone for.

 Signature 

Ian Beck
MacRabbit Support

Follow us on Twitter, or try my custom themes: Quiet Light & Earthworm

Profile