Skip to content

Instantly share code, notes, and snippets.

@riywo
Created December 2, 2010 16:45
Show Gist options
  • Save riywo/725640 to your computer and use it in GitHub Desktop.
Save riywo/725640 to your computer and use it in GitHub Desktop.
easy QueryComment(where the query executed)
my $dbh = DBI->connect('dbi:mysql:test','test','test', {
RaiseError => 1,
Callbacks => {
ChildCallbacks => {
execute => sub {
my ($obj, @binds) = @_;
my ($package, $file, $line) = caller;
$obj->{Database}->{Statement} .= "/* $package:$file:$line */";
return;
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment