Ruby Forum Ruby on Rails > how can we see mysql query.........

Posted by Manish Nautiyal (manish)
on 05.05.2008 21:44
HI I m new to ROR......
I m a PHP developer......my query is
like in php when we have to see mysql query we just echo it to see it.
Is there any function - method is in ROR to see what the query is
running rite now.
Posted by Phillip Koebbe (pkoebbe)
on 05.05.2008 21:51
Manish Nautiyal wrote:
> HI I m new to ROR......
> I m a PHP developer......my query is
> like in php when we have to see mysql query we just echo it to see it.
> Is there any function - method is in ROR to see what the query is
> running rite now.

You can look in the development.log in the log folder.

Peace,
Phillip
Posted by alberto (Guest)
on 06.05.2008 03:04
(Received via mailing list)
You might find it helpful to have the following 4 console windows open
in your dev environment:

> mongrel_rails start; if you are using rails
this is where your code will show the debugger if you type debugger
anywhere in the code

> cd log; tail -f development.log
to see the log of all the activity as you hit the browser as you code.
This is where the SQL queries will show up as well as any warnings,
code as it is evaluated, etc.

> script/console
you want to have the script/console open so that you can easily test
expressions, etc.

> path to your app
so that you can run the migrations, rake tasks.