[Jifty-commit] r1181 - Jifty-DBI/trunk/lib/Jifty/DBI
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Jun 7 00:31:22 EDT 2006
Author: clkao
Date: Wed Jun 7 00:31:21 2006
New Revision: 1181
Modified:
Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm
Log:
Integrate today's hack for dumping callers for sql queries in
question.
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm Wed Jun 7 00:31:21 2006
@@ -13,6 +13,15 @@
our $VERSION = '0.01';
+if (my $pattern = $ENV{JIFTY_DBQUERY_CALLER}) {
+ require Hook::LexWrap;
+ Hook::LexWrap::wrap('Jifty::DBI::Handle::simple_query', pre => sub {
+ return unless $_[1] =~ m/$pattern/;
+ warn $_[1]."\n";
+ Carp::cluck;
+ });
+}
+
=head1 NAME
Jifty::DBI::Handle - Perl extension which is a generic DBI handle
@@ -31,7 +40,8 @@
=head1 DESCRIPTION
-This class provides a wrapper for DBI handles that can also perform a number of additional functions.
+This class provides a wrapper for DBI handles that can also perform a
+number of additional functions.
=cut
@@ -996,6 +1006,12 @@
__END__
+=head DIAGNOSIS
+
+Setting C<JIFTY_DBQUERY_CALLER> environment variable will make
+L<Jifty::DBI> dump the caller for the SQL queries matching it. See
+also C<DBI> about setting C<DBI_PROFILE>.
+
=head1 AUTHOR
Jesse Vincent, jesse at fsck.com
More information about the Jifty-commit
mailing list