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


DBIx-Roles documentation  | view source Contained in the DBIx-Roles distribution.

Index


NAME

Top

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

DESCRIPTION

Top

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

Top

     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

Top

DBIx::Roles.

COPYRIGHT

Top

AUTHOR

Top

Dmitry Karasik <dk@catpipe.net>


DBIx-Roles documentation  | view source Contained in the DBIx-Roles distribution.