Hi,
On Jun 18, 2008, at 2:39 PM, Drew Taylor wrote:
On Wed, Jun 18, 2008 at 2:18 PM, Ovid <[EMAIL PROTECTED]>
wrote:
--- Drew Taylor <[EMAIL PROTECTED]> wrote:
So I guess this all goes back to my original question: when I'm
running DBIx::Class, is there any way I can trap the SQL and bind
parameters used so I can potentially cache them?
Yes, you can create your own statistics subclass. See http://
search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Storage/Statistics.pm
It will have access to the SQL and the bind parameters.
You can dump the queries and the bind values using $ENV{DBIC_TRACE}. I
suppose you could redirect that to a separate file somehow and parse
it from there. That is pushing the extent of my DBIC internals
knowledge, so someone else will have to chime in.
Actually DBIC_TRACE can be a filename. The syntax is:
$ENV{DBIC_TRACE} = '1=/tmp/trace.out';
See http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/
Troubleshooting.pod for more info.
Best regards,
--
Pedro Melo
Blog: http://www.simplicidade.org/notes/
XMPP ID: [EMAIL PROTECTED]
Use XMPP!
_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]