The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DBIx::Roles::Hook - Exports callbacks to override DBI calls.

DESCRIPTION

Exports a single attribute Hooks that is a hash, where keys are connect, disconnect, any, rewrite, dbi_method, STORE, and values are code references, to be called when the corresponding calls occur.

SYNOPSIS

     use DBIx::Roles qw(Hook);

     my $dbh = DBI-> connect(
           "dbi:Pg:dbname=template1",
           "postgres",
           "password",
           {
               Hooks => {
                   do => sub {
                       my ( $self, undef, @param) = @_;
                       return 42; # no do
                   },
               }
           }
     );

     print $dbh-> do("SELECT meaning FROM life");

SEE ALSO

DBIx::Roles.

COPYRIGHT

Copyright (c) 2005 catpipe Systems ApS. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Dmitry Karasik <dk@catpipe.net>