Extracting SQL statements from the rails development log

13 views
Skip to first unread message

Gurdipe Dosanjh

unread,
Jun 19, 2012, 3:46:12 PM6/19/12
to rubyonra...@googlegroups.com
Hi 

I need to extract all the sql statements from the the rails development log.

Is there a quick way to do this using a regular expression or another method?

Kind Regards

Gurdipe

Robert Walker

unread,
Jun 19, 2012, 6:54:14 PM6/19/12
to rubyonra...@googlegroups.com
Gurdipe Dosanjh wrote in post #1065210:
> I need to extract all the sql statements from the the rails development
> log.
>
> Is there a quick way to do this using a regular expression or another
> method?

This makes it sound unlikely:

http://stackoverflow.com/questions/139926/regular-expression-to-match-common-sql-syntax

BTW, is your Google broken? This is was the second link in my Google.

--
Posted via http://www.ruby-forum.com/.

Matt Jones

unread,
Jun 20, 2012, 7:54:59 AM6/20/12
to rubyonra...@googlegroups.com


On Tuesday, 19 June 2012 15:46:12 UTC-4, Gurdipe Dosanjh wrote:
Hi 

I need to extract all the sql statements from the the rails development log.

Is there a quick way to do this using a regular expression or another method?


If you're looking to grab all the queries, check out the Notification system:


the 'sql.active_record' notification will be fired every time there's a query.

--Matt Jones 
Reply all
Reply to author
Forward
0 new messages