DBIx::Roles::Hook - Exports callbacks to override DBI calls.
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.
Hooks
connect
disconnect
any
rewrite
dbi_method
STORE
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");
DBIx::Roles.
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.
Dmitry Karasik <dk@catpipe.net>
To install DBIx::Roles, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Roles
CPAN shell
perl -MCPAN -e shell install DBIx::Roles
For more information on module installation, please visit the detailed CPAN module installation guide.