[TxMt] snippets for MySQL; escaping "`"?

kumar mcmillan kmcmillan at leapfrogonline.com
Wed Nov 10 15:51:52 UTC 2004


until it's fixed in TextMate, you can probably get by with leaving off 
the backticks in all your SQL queries.  The only time you would need 
them is if the mysql field, table, or database name includes some 
character that is not alphanumeric or an underscore.  Plus, you would 
be writing more portable SQL code by leaving out the backticks and 
avoiding funny characters in your identifiers altogether.

k

On Nov 9, 2004, at 8:45 AM, Paul Nordstrom August wrote:

> I'm about to embark on a lengthy and complex project (changing 30-odd 
> FileMaker tables into MySQL). Usually I use the (excellent) CocoaMySQL 
> for table creation but I thought I'd explore using snippets in TM...
>
> Basically it works like a charm (create table, add date field, add 
> varchar, add int...), though I haven't tested it vs CocoaMySQL to see 
> which will be faster (as CMS offers more tweaking of the field 
> definitions). But I figure I can whack out the fields in TM then 
> import the whole .sql file into CMS for the tweaking, adding indexes, 
> etc.
>
>> CREATE TABLE textmate (
>>   textmate_id int(11) NOT NULL auto_increment,
>>   tm_user varchar(50) default NULL,
>>   user_no int(5) default NULL,
>>   user_email varchar(50) default NULL,
>>   entry_date date default NULL,
>>   PRIMARY KEY (textmate_id)
>> ) ENGINE=InnoDB;
>
> The one thing I can't manage to sort out is including e.g. 
> "`textmate_id`" since the "`" is used in the snippets to evoke a shell 
> command... I tried escaping with "\`" but that didn't work. Am I 
> missing something obvious?
>
> In any case, it's clear that snippets can revolutionize coding :) Wish 
> I had more time to explore... embedding shell commands could be 
> fantastic...
>
> Paul
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list