Dmitry Karasik > DBIx-Roles-1.04 > DBIx::Roles::Hook

Download:
DBIx-Roles-1.04.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.00   Source  

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>

syntax highlighting: