[TxMt] MySQL queries in TM (simple attempts thus far)

Paul Nordstrom August paul at archivistes.com
Tue Nov 2 17:16:25 UTC 2004


hi Mats,
Well I'm just fooling around at present (and I'm hardly a unix geek!)...
The key is to have a MySQL user defined on localhost w/o a password and 
then grant selected privileges. Obviously you have to be careful here 
with regards to security and what you permit :)

The output is a bit messy but I've done a few simple commands e.g. the 
following. I haven't had time yet to explore more complex SELECT 
queries. But presumably one could wrap the whole thing up in macros to 
tidy it up. (I use macros extensively to convert DESCRIBE queries into 
various other queries by parsing out the field names.)

Note that after the mysql dengue -e "YOUR QUERY HERE" you hit ctrl-R of 
course ;)

> mysql dengue -e "SHOW TABLES"Tables_in_dengue
> bairropos
> bairrostats
> denguemenu
> elispotplates
> elispotwells
> poolpeptides
> pools
> poolsheets
> samples
> weeklypos
> weeklystats
> wellset_a
> wellset_b
> wellset_c
>
> mysql dengue -e "DESCRIBE weeklystats"Field	Type	Null	Key	Default	Extra
> week	int(6)	YES		NULL	
> samplecount	int(4)	YES		NULL	
> poscount	int(4)	YES		NULL	
> posrate	decimal(3,2)	YES		NULL	
> month	char(3)	YES		NULL	

Hope this helps. No doubt others have found a more elegant approach!
Cheers and thanks for your interest.
Paul

On 2 Nov 2004, at 15:58, Mats Persson wrote:

> On Nov 2, 2004, at 12:53, Paul Nordstrom August wrote:
>>  I found myself running MySQL queries directly in TM... cool! Just 
>> think of the possibilities with a macro :)
>
> Hmm, care to share how you are doing the MySQL queries directly in TM 
> ??  It might be obvious, but I just can't see it right now.
>
> Kind regards,
>
> Mats
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/mailman/listinfo/textmate




More information about the textmate mailing list