[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby based mysql sniffer

Junkone

9/5/2008 2:09:00 PM

therei sone in perl. i am looking for a equavalent in ruby. i just
want to trace the sql statements being executed by mysql as i cannot
debug my client app to find out what sql it is sending out to the
database.
http://iank.org/que...
2 Answers

Joost Diepenmaat

9/5/2008 4:12:00 PM

0

Junkone <junkone1@gmail.com> writes:

> therei sone in perl. i am looking for a equavalent in ruby. i just
> want to trace the sql statements being executed by mysql as i cannot
> debug my client app to find out what sql it is sending out to the
> database.

1. why don't you just turn on logging in mysql and check out the query
log?

2. since you can't debug the client app (whatever that means) does it
matter what language the sniffer is written in?

ho pet hishelps

--
Joost Diepenmaat | blog: http://joost.... | work: http://...

Phlip

9/5/2008 7:02:00 PM

0

Junkone wrote:

> therei sone in perl. i am looking for a equavalent in ruby. i just
> want to trace the sql statements being executed by mysql as i cannot
> debug my client app to find out what sql it is sending out to the
> database.

If you use ActiveRecord, try assert_latest{}. It returns an array of arrays
containing all SELECT statements emitted during its block, including their
EXPLAIN results.

But if you need something lower level, doesn't MySQL itself have a query logging
option?

--
Phlip