Ruby based mysql sniffer

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/querysniffer/

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?

Junkone [email protected] 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