Result:
found more than 837 distributions - search limited to the first 2001 files matching your query ( run in 0.764 )


DBIx-Class-CustomPrefetch

 view release on metacpan or  search on metacpan

Debian_CPANTS.txt  view on Meta::CPAN

"libmarc-crosswalk-dublincore-perl", "MARC-Crosswalk-DublinCore", "0.02", "0", "0"
"libmarc-lint-perl", "MARC-Lint", "1.44", "0", "0"
"libmarc-perl", "MARC", "1.07", "0", "0"
"libmarc-record-perl", "MARC-Record", "2.0.0", "0", "0"
"libmarc-xml-perl", "MARC-XML", "0.92", "0", "0"
"libmasonx-interp-withcallbacks-perl", "MasonX-Interp-WithCallbacks", "1.18", "0", "0"
"libmath-algebra-symbols-perl", "Math-Algebra-Symbols", "1.21", "0", "0"
"libmath-basecalc-perl", "Math-BaseCalc", "1.013", "0", "0"
"libmath-basecnv-perl", "Math-BaseCnv", "1.4.75O6Pbr", "0", "0"
"libmath-bigint-gmp-perl", "Math-BigInt-GMP", "1.24", "1", "0"
"libmath-calc-units-perl", "Math-Calc-Units", "1.07", "0", "0"

 view all matches for this distribution


DBIx-Class-DynamicDefault

 view release on metacpan or  search on metacpan

lib/DBIx/Class/DynamicDefault.pm  view on Meta::CPAN


=head2 always_update

  always_update => 1

When setting C<always_update> to 1 C<dynamic_default_on_update> callbacks will
always be invoked, even if no other columns are dirty.

=head1 AUTHOR

Florian Ragwitz E<lt>rafl@debian.orgE<gt>

 view all matches for this distribution


DBIx-Class-Fixtures

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Fixtures.pm  view on Meta::CPAN

  }

  my $fixup_visitor;
  my $formatter = $schema->storage->datetime_parser;
  unless ($@ || !$formatter) {
    my %callbacks;
    if ($params->{datetime_relative_to}) {
      $callbacks{'DateTime::Duration'} = sub {
        $params->{datetime_relative_to}->clone->add_duration($_);
      };
    } else {
      $callbacks{'DateTime::Duration'} = sub {
        $formatter->format_datetime(DateTime->today->add_duration($_))
      };
    }
    $callbacks{object} ||= "visit_ref";
    $fixup_visitor = new Data::Visitor::Callback(%callbacks);
  }

  my @sorted_source_names = $self->_get_sorted_sources( $schema );
  $schema->storage->txn_do(sub {
    $schema->storage->with_deferred_fk_checks(sub {

 view all matches for this distribution


DBIx-Class-Helpers

 view release on metacpan or  search on metacpan

lib/DBIx/Class/Helper/Row/OnColumnChange.pm  view on Meta::CPAN


=back

=head1 NO SURPRISE RACE CONDITIONS

One thing that should be made totally clear is that the column change callbacks
are in effect B<< only once >> in a given update.  If you expect to be able to
do something weird like calling one of the callbacks which changes a value with
an accessor which calls a callback etc etc, you probably just need to write some
code to do that yourself.  This helper is specifically made with the aim of
reacting to changes immediately before they hit the database.

=head1 METHODS

lib/DBIx/Class/Helper/Row/OnColumnChange.pm  view on Meta::CPAN

 );

Note: the arguments passed to C<method> will be
C<< $self, $next, $old_value, $new_value >>.

Around is subtly different than the other two callbacks.  You B<must> call
C<$next> in your method or it will not work at all.  A silly example of how
this is done could be:

 sub around_change_name {
   my ($self, $next, $old, $new) = @_;

 view all matches for this distribution


DBIx-Class-Migration

 view release on metacpan or  search on metacpan

lib/Catalyst/TraitFor/Model/DBIC/Schema/FromMigration.pm  view on Meta::CPAN

=head2 install_if_needed

Accepts Bool|HashRef, Optional

If this is a true value, run the L<DBIx::Class::Migration/install_if_needed>
method.  If the value is a Hashref, we will assume it is a hashref of callbacks
as documented, and use it as an argument (after de-reffing it).

=head1 METHODS

This role exposes the following public methods

 view all matches for this distribution


DBIx-Class-Schema-Loader

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.07013  2011-11-17 23:12:47
        - automatically prefix database/schema to clashing monikers for
          the same table name in multischema configurations

0.07012  2011-11-09 15:16:29
        - as of 0.07011 all callbacks receive a ::Loader::Table or
          interface-compatible object instead of the table name, this object
          stringifies to the table name (RT#72260)
        - fix a bug in dynamic schema_base_class/schema_components
          implementation that ran the connection method twice on subsequent
          connects

 view all matches for this distribution


DBIx-Class

 view release on metacpan or  search on metacpan

t/storage/on_connect_call.t  view on Meta::CPAN

use DBI;
use DBICTest;
use DBICTest::Schema;
use DBIx::Class::Storage::DBI;

# !!! do not replace this with done_testing - tests reside in the callbacks
# !!! number of calls is important
use Test::More tests => 17;
# !!!
use Test::Warn;

 view all matches for this distribution


DBIx-Connector-Pool

 view release on metacpan or  search on metacpan

lib/DBIx/Connector/Pool.pm  view on Meta::CPAN


=head1 Description
 
L<DBI> is great and L<DBIx::Connector> is a nice interface with good features 
to it. But when it comes to work in some asynchronous environment like
L<AnyEvent> you have to use something another with callbacks if you don't want
to block your event loop completely waiting for data from DB. This module 
(together with L<DBIx::PgCoroAnyEvent> for PostgreSQL or some another alike) 
was developed to overcome this inconvenience. You can write your "normal" DBI
code without blocking your event loop. 

 view all matches for this distribution


DBIx-Connector

 view release on metacpan or  search on metacpan

lib/DBIx/Connector.pm  view on Meta::CPAN

won't get the transactional scoping behavior of those two methods.

If you would like to execute custom logic each time a new connection to the
database is made you can pass a sub as the C<connected> key to the
C<Callbacks> parameter. See L<DBI/Callbacks> for usage and other available
callbacks.

Other attributes may be modified by individual drivers. See the documentation
for the drivers for details:

=over

 view all matches for this distribution


DBIx-DBO2

 view release on metacpan or  search on metacpan

DBO2/Record.pm  view on Meta::CPAN


########################################################################

=head2 Hooks

Many of the methods below are labeled "Inheritable Hook." These methods allow you to register callbacks which are then invoked at specific points in each record's lifecycle. You can add these callbacks to all record classes, to a particular class, or...

To register a callback, call the install_hooks method, and pass it pairs of a hook method name, and a subroutine reference, as follows: I<callee>->install_hooks( I<methodname> => I<coderef>, ... ).

Here are a few examples to show the possibilities this provides you with:

 view all matches for this distribution


DBIx-DBSchema

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


0.35 2007-10-29 18:58:36 PDT
    - Fix minor breakage (pretty_print) resulting from Jesse's changes.
    - Update mysql driver to handle BIGSERIAL columns
    - Update Column.pm, move all mysql and Pg-specific code to DBD driver
      callbacks
    - Update Table.pm, add local_options
    - Fix mysql NULL reverse-engineering and updating code

0.34 2007-08-19 10:08:51 PDT
    - More work on update schema from Slaven Rezic <srezic@cpan.org>,

 view all matches for this distribution


DBIx-DataModel

 view release on metacpan or  search on metacpan

lib/DBIx/DataModel/Schema.pm  view on Meta::CPAN

  my ($self, $coderef) = @_;
  ref $self or $self = $self->singleton;

  $self->{transaction_dbhs}
    or croak "do_after_commit() called outside of a transaction";
  push @{$self->{after_commit_callbacks}}, $coderef;
}


sub do_transaction { 
  my ($self, $coderef, @new_dbh) = @_; 

lib/DBIx/DataModel/Schema.pm  view on Meta::CPAN

        foreach my $dbh (reverse @$transaction_dbhs) {
          try   {$dbh->rollback}
            catch {push @rollback_errs, $_};
        }
        delete $self->{transaction_dbhs};
        delete $self->{after_commit_callbacks};
        DBIx::DataModel::Schema::_Exception->throw($err, @rollback_errs);
      };
    }
  }

  # execute the after_commit callbacks
  my $callbacks = delete $self->{after_commit_callbacks} || [];
  $_->() foreach @$callbacks;

  return $in_context->{return}->();
}


 view all matches for this distribution


DBIx-FileSystem

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

	- comcol in %vdirs hash introduced: define a column that will hold
	  comments for a file
	- introduced new commands 'll' and 'ld' 
	- check length of fnamcol column againtst $LS_COL_WIDTH
	- added possibility to add custom commands
	- rmcheck and volok callbacks: added param dbh

1.07	21 july 2003
	- added missing t/use.t to MANIFEST

1.08 	11 aug 2003 

 view all matches for this distribution


DBIx-FlexibleBinding

 view release on metacpan or  search on metacpan

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

BEGIN {
    *_is_hashref     = \&DBIx::FlexibleBinding::_is_hashref;
    *_as_list_or_ref = \&DBIx::FlexibleBinding::_as_list_or_ref;
}

use Params::Callbacks 'callbacks';
use namespace::clean;

our @ISA = 'DBI::db';

sub do
{
    my ( $callbacks, $dbh, $sth, @bind_values ) = &callbacks;
    my $result;
    unless ( ref $sth ) {
        my $attr;
        $attr = shift @bind_values
            if _is_hashref( $bind_values[0] );

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    }
    $result = $sth->execute( @bind_values );
    return undef
        if $sth->err;
    local $_;
    $result = $callbacks->smart_transform( $_ = $result )
        if @$callbacks;
    return $result;
}

sub prepare
{

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    return $sth;
}

sub getrows_arrayref
{
    my ( $callbacks, $dbh, $sth, @bind_values ) = &callbacks;
    unless ( ref $sth ) {
        my $attr;
        $attr = shift( @bind_values )
            if _is_hashref( $bind_values[0] );
        $sth = $dbh->prepare( $sth, $attr );

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

            if $sth->err;
    }
    $sth->execute( @bind_values );
    return _as_list_or_ref( undef )
        if $sth->err;
    return $sth->getrows_arrayref( $callbacks );
}

sub getrows_hashref
{
    my ( $callbacks, $dbh, $sth, @bind_values ) = &callbacks;
    unless ( ref $sth ) {
        my $attr;
        $attr = shift( @bind_values )
            if _is_hashref( $bind_values[0] );
        $sth = $dbh->prepare( $sth, $attr );

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

            if $sth->err;
    }
    $sth->execute( @bind_values );
    return _as_list_or_ref( undef )
        if $sth->err;
    return $sth->getrows_hashref( $callbacks );
}

sub getrow_arrayref
{
    my ( $callbacks, $dbh, $sth, @bind_values ) = &callbacks;
    unless ( ref $sth ) {
        my $attr;
        $attr = shift( @bind_values )
            if _is_hashref( $bind_values[0] );
        $sth = $dbh->prepare( $sth, $attr );

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    }

    $sth->execute( @bind_values );
    return undef
        if $sth->err;
    return $sth->getrow_arrayref( $callbacks );
}

sub getrow_hashref
{
    my ( $callbacks, $dbh, $sth, @bind_values ) = &callbacks;
    unless ( ref $sth ) {
        my $attr;
        $attr = shift( @bind_values )
            if _is_hashref( $bind_values[0] );
        $sth = $dbh->prepare( $sth, $attr );

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

            if $sth->err;
    }
    $sth->execute( @bind_values );
    return undef
        if $sth->err;
    return $sth->getrow_hashref( $callbacks );
}

BEGIN {
    *getrows = \&getrows_hashref;
    *getrow  = \&getrow_hashref;

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    *_is_hashref     = \&DBIx::FlexibleBinding::_is_hashref;
    *_as_list_or_ref = \&DBIx::FlexibleBinding::_as_list_or_ref;
}

use List::MoreUtils   ( 'any' );
use Params::Callbacks ( 'callbacks' );
use namespace::clean;
use message << 'EOF';
ERR_EXP_AHR         Expected a reference to a HASH or ARRAY
ERR_MISSING_BIND_ID Binding identifier is missing
ERR_BAD_BIND_ID     Bad binding identifier (%s)

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    return $rows;
}

sub iterate
{
    my ( $callbacks, $sth, @bind_values ) = &callbacks;
    my $rows = $sth->execute( @bind_values );
    return $rows unless defined $rows;
    my $iter_fn = sub { $sth->getrow( $callbacks ) };
    return bless( $iter_fn, 'DBIx::FlexibleBinding::Iterator' );
}

sub getrows_arrayref
{
    my ( $callbacks, $sth, @args ) = &callbacks;
    unless ( $sth->{Active} ) {
        $sth->execute( @args );
        return _as_list_or_ref( undef )
            if $sth->err;
    }
    my $result = $sth->fetchall_arrayref;
    return _as_list_or_ref( $result )
        if $sth->err or not defined $result;
    local $_;
    $result = [ map { $callbacks->transform( $_ ) } @$result ]
        if @$callbacks;
    return _as_list_or_ref( $result );
}

sub getrows_hashref
{
    my ( $callbacks, $sth, @args ) = &callbacks;
    unless ( $sth->{Active} ) {
        $sth->execute( @args );
        return _as_list_or_ref( undef )
            if $sth->err;
    }
    my $result = $sth->fetchall_arrayref( {} );
    return _as_list_or_ref( $result )
        if $sth->err or not defined $result;
    local $_;
    $result = [ map { $callbacks->transform( $_ ) } @$result ]
        if @$callbacks;
    return _as_list_or_ref( $result );
}

sub getrow_arrayref
{
    my ( $callbacks, $sth, @args ) = &callbacks;
    unless ( $sth->{Active} ) {
        $sth->execute( @args );
        return undef
            if $sth->err;
    }
    my $result = $sth->fetchrow_arrayref;
    return $result
        if $sth->err or not defined $result;
    local $_;
    $result = [@$result];
    $result = $callbacks->smart_transform( $_ = $result )
        if @$callbacks;
    return $result;
}

sub getrow_hashref
{
    my ( $callbacks, $sth, @args ) = &callbacks;
    unless ( $sth->{Active} ) {
        $sth->execute( @args );
        return undef
            if $sth->err;
    }
    my $result = $sth->fetchrow_hashref;
    return $result
        if $sth->err or not defined $result;
    local $_;
    $result = $callbacks->smart_transform( $_ = $result )
        if @$callbacks;
    return $result;
}

BEGIN {
    *getrows = \&getrows_hashref;

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN


package    # Hide from PAUSE
    DBIx::FlexibleBinding::Iterator;
our $VERSION = '2.0.4'; # VERSION

use Params::Callbacks ( 'callbacks' );
use namespace::clean;

sub for_each
{
    my ( $callbacks, $iter ) = &callbacks;
    my @results;
    local $_;
    while ( my @items = $iter->() ) {
        last if @items == 1 and not defined $items[0];
        push @results, map { $callbacks->transform( $_ ) } @items;
    }
    return wantarray ? @results : \@results;
}

1;

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

rows affected or undef on error. A return value of -1 means the number of rows
is not known, not applicable, or not available. When no rows have been affected
this method continues the C<DBI> tradition of returning C<0E0> on successful
execution and C<undef> on failure.

The C<do> method accepts optional callbacks for further processing of the result.

The C<do> implementation provided by this module allows for some minor
deviations in usage over the standard C<DBI> implementation. In spite
of this, the new method may be used just like the original.

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    @results = $dbh->getrows_arrayref($statement_handle, @bind_values);

Prepares (if necessary) and executes a single statement with the specified data
bindings and fetches the result set as an array of array references.

The C<getrows_arrayref> method accepts optional callbacks for further processing
of the results by the caller.

B<Examples>

=over

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN


=item 3. Re-use a prepared statement, execute it then return modified results as a
reference:

We'll use the query from Example 1 but have the results returned as a list
for further processing by a caller who will be using callbacks to modify those
results.

    $sth = $dbh->prepare($sql);

    $systems = $dbh->getrows_arrayref($sql, minimum_security => 1.0, callback {

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    @results = $dbh->getrows_hashref($statement_handle, @bind_values);

Prepares (if necessary) and executes a single statement with the specified data
bindings and fetches the result set as an array of hash references.

The C<getrows_hashref> method accepts optional callbacks for further processing
of the results by the caller.

B<Examples>

=over

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN


=item 3. Re-use a prepared statement, execute it then return modified results as a
reference:

We'll use the query from Example 1 but have the results returned as a list
for further processing by a caller who will be using callbacks to modify those
results.

    $sth = $dbh->prepare($sql);

    $systems = $dbh->getrows_hashref($sql, minimum_security => 1.0, callback {

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

Alias for C<getrows_hashref>.

If array references are preferred, have the symbol table glob point alias the 
C<getrows_arrayref> method.

The C<getrows> method accepts optional callbacks for further processing
of the results by the caller.

=head2 getrow_arrayref I<(database handles)>

    $result = $dbh->getrow_arrayref($statement_string, @bind_values);

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    $result = $dbh->getrow_arrayref($statement_handle, @bind_values);

Prepares (if necessary) and executes a single statement with the specified data
bindings and fetches the first row as an array reference.

The C<getrow_arrayref> method accepts optional callbacks for further processing
of the result by the caller.

=head2 getrow_hashref I<(database handles)>

    $result = $dbh->getrow_hashref($statement_string, @bind_values);

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    $result = $dbh->getrow_hashref($statement_handle, @bind_values);

Prepares (if necessary) and executes a single statement with the specified data
bindings and fetches the first row as a hash reference.

The C<getrow_hashref> method accepts optional callbacks for further processing
of the result by the caller.

=head2 getrow I<(database handles)>

    $result = $dbh->getrow($statement_string, @bind_values);

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

Alias for C<getrow_hashref>.

If array references are preferred, have the symbol table glob point alias the 
C<getrows_arrayref> method.

The C<getrow> method accepts optional callbacks for further processing
of the result by the caller.

=head1 STATEMENT HANDLE METHODS

=head2 bind_param

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN


B<Examples>

=over

=item 1. Using an iterator and callbacks to process the result set:

    use strict;
    use warnings;

    use DBIx::FlexibleBinding -subs => [ 'TestDB' ];

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN


In this example, we're traversing the result set using an iterator. As we iterate
through the result set, a callback is applied to each row and we're left with
an array of transformed rows.

=item 2. Using an iterator's C<for_each> method and callbacks to process the
result set:

    use strict;
    use warnings;

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

    $results = $sth->getrows_arrayref();
    @results = $sth->getrows_arrayref();

Fetches the entire result set as an array of array references.

The C<getrows_arrayref> method accepts optional callbacks for further processing
of the results by the caller.

=head2 getrows_hashref I<(database handles)>

    $results = $sth->getrows_hashref();
    @results = $sth->getrows_hashref();

Fetches the entire result set as an array of hash references.

The C<getrows_hashref> method accepts optional callbacks for further processing
of the results by the caller.

=head2 getrows I<(database handles)>

    $results = $sth->getrows();

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

Alias for C<getrows_hashref>.

If array references are preferred, have the symbol table glob point alias the 
C<getrows_arrayref> method.

The C<getrows> method accepts optional callbacks for further processing
of the results by the caller.

=head2 getrow_arrayref I<(database handles)>

    $result = $sth->getrow_arrayref();

Fetches the next row as an array reference. Returns C<undef> if there are no more
rows available.

The C<getrow_arrayref> method accepts optional callbacks for further processing
of the result by the caller.

=head2 getrow_hashref I<(database handles)>

    $result = $sth->getrow_hashref();

Fetches the next row as a hash reference. Returns C<undef> if there are no more
rows available.

The C<getrow_hashref> method accepts optional callbacks for further processing
of the result by the caller.

=head2 getrow I<(database handles)>

    $result = $sth->getrow();

lib/DBIx/FlexibleBinding.pm  view on Meta::CPAN

Alias for C<getrow_hashref>.

If array references are preferred, have the symbol table glob point alias the 
C<getrows_arrayref> method.

The C<getrow> method accepts optional callbacks for further processing
of the result by the caller.

=head1 EXPORTS

The following symbols are exported by default:

=head2 callback

To enable the namespace using this module to take advantage of the callbacks,
which are one of its main features, without the unnecessary burden of also
including the module that provides the feature I<(see L<Params::Callbacks> for
more detailed information)>.

=head1 SEE ALSO

 view all matches for this distribution


DBIx-HTMLinterface

 view release on metacpan or  search on metacpan

HTMLinterface.pm  view on Meta::CPAN


=over 4

=item Future Additions

In a later version, callbacks to print table cells, start and finish tables, 
print form fields, print back links and add user defined form parameters to 
allow state keeping such as password protection etc.

=item B<set_printheader>

 view all matches for this distribution


DBIx-ObjectMapper

 view release on metacpan or  search on metacpan

lib/DBIx/ObjectMapper/Log.pm  view on Meta::CPAN

                'Screen',
                min_level => $min_level,
                newline => 1,
            ]
        ],
        callbacks => sub {
            my %param = @_;
            return sprintf("[%s] %s", $param{level}, $param{message});
        }
    );
};

 view all matches for this distribution


DBIx-OnlineDDL

 view release on metacpan or  search on metacpan

lib/DBIx/OnlineDDL.pm  view on Meta::CPAN

        # Make sure the basic settings are sane
        $dbi_attrs->{AutoCommit} = 1;
        $dbi_attrs->{RaiseError} = 1;

        # Add the DBI callback
        my $callbacks  = $dbi_attrs->{Callbacks} //= {};
        my $package_re = quotemeta(__PACKAGE__.'::_dbi_connected_callback');

        my $ref = defined $callbacks->{connected} && ref $callbacks->{connected};
        unless ($callbacks->{connected}) {
            $callbacks->{connected} = set_subname '_dbi_connected_callback' => sub {
                shift->do($_) for @stmts;
                return;
            };
        }
        elsif (!$ref || $ref ne 'CODE') {
            die "Illegal reftype $ref for connected DBI Callback!";
        }
        elsif (subname($callbacks->{connected}) =~ /^$package_re/) {  # allow for *_wrapped below
            # This is one of our callbacks; leave it alone!
        }
        else {
            # This is somebody else's callback; wrap around it
            my $old_coderef = $callbacks->{connected};
            $callbacks->{connected} = set_subname '_dbi_connected_callback_wrapped' => sub {
                my $h = shift;
                $old_coderef->($h);
                $h->do($_) for @stmts;
                return;
            };

 view all matches for this distribution


DBIx-Oracle-UpgradeUtf8

 view release on metacpan or  search on metacpan

lib/DBIx/Oracle/UpgradeUtf8.pm  view on Meta::CPAN

  # return object
  bless $self, $class;
}


sub inject_callbacks {
  my ($self, $dbh, @invalid_args) = @_;

  # check input args
  $dbh->isa('DBI::db') or die '->inject_callbacks() : arg is not a database handle';
  !@invalid_args       or die '->inject_callbacks() : too many args';

  # coderef to be installed as common callback for all methods. This is a closure on $debug.
  my $debug = $self->{debug};                 # Copy for easier reference. The coderef will be a closure on $debug.
  my $upgrade_string_args = sub {
    $debug->("$_ callback") if $debug;        # Note: $_ is the method name

lib/DBIx/Oracle/UpgradeUtf8.pm  view on Meta::CPAN

    }

    return; # must end with an empty return (see L<DBI> documentation)
  };

  # inject callbacks for $dbh methods and for $sth methods
  my $parent_callbacks = $dbh->{Callbacks}                   //= {};
  my $child_callbacks  = $parent_callbacks->{ChildCallbacks} //= {};
  inject_callback($parent_callbacks, $_ => $upgrade_string_args)  for @{$self->{dbh_methods}};
  inject_callback($child_callbacks,  $_ => $upgrade_string_args)  for @{$self->{sth_methods}};
}


sub inject_callback {
  my ($hash, $key, $coderef) = @_;

 view all matches for this distribution


DBIx-Poggy

 view release on metacpan or  search on metacpan

lib/DBIx/Poggy.pm  view on Meta::CPAN


    $cv->recv;

=head1 DESCRIPTION

"Async" postgres as much as L<DBD::Pg> allows with L<Promises> instead of callbacks.

You get DBI interface you used to that returns promises, connections pool, queries
queuing and support of transactions.

=head2 Why pool?

 view all matches for this distribution


DBIx-QuickORM

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.000010  2025-05-07 06:36:38-07:00 America/Los_Angeles (TRIAL RELEASE)

    - Still felshing out functionality after the rewrite
    - Add 'forked' async emulation
    - Add 'aside' async functionality
    - Add more txn callbacks

0.000009  2025-05-06 08:17:08-07:00 America/Los_Angeles (TRIAL RELEASE)

0.000008  2025-05-02 01:20:14-07:00 America/Los_Angeles (TRIAL RELEASE)

 view all matches for this distribution


DBIx-RetryOverDisconnects

 view release on metacpan or  search on metacpan

lib/DBIx/RetryOverDisconnects.pm  view on Meta::CPAN


=head2 set_callback

    $dbh->set_callback(afterReconnect => $code_ref);

Set callbacks for some events. Currently only afterReconnect is supported.
It is called after every successful reconnect to database.

=cut

sub set_callback {
    my ($self, %callbacks) = @_;
    my $old = $self->{PRIV()}->{callback} || {};
    $self->{PRIV()}->{callback} = {%$old, %callbacks};
    return;
}

sub exc_conn_trans {
    my $self = shift;

 view all matches for this distribution


DBIx-Roles

 view release on metacpan or  search on metacpan

Roles.pm  view on Meta::CPAN


C<DBIx::Roles::Default> - not a module on its own, but a package that is
always imported, and need not to be imported explicitly. Implements actual calls
to DBI handle.

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

L<DBIx::Roles::InlineArray> - Flattens arrays passed as parameters to DBI calls into strings.

L<DBIx::Roles::RaiseError> - Change defaults to C<< RaiseError => 1 >>

 view all matches for this distribution


DBIx-SQLEngine

 view release on metacpan or  search on metacpan

SQLEngine/Record/Hooks.pm  view on Meta::CPAN

  
  package My::Record;
  use DBIx::SQLEngine::Record::Class '-isasubclass', 'Hooks';  
  My::Record->table( $sqldb->table($table_name) );

B<Hooks:> Register subs for callbacks.

  DBIx::SQLEngine::Record::Hooks->install_hooks( 
    post_new    => sub { warn "Record $_[0] created" },
    post_fetch  => sub { warn "Record $_[0] loaded" },
    post_insert => sub { warn "Record $_[0] inserted" },

SQLEngine/Record/Hooks.pm  view on Meta::CPAN


########################################################################

=head1 HOOKS INTERFACE

Many of the methods below are labeled "Inheritable Hook." These methods allow you to register callbacks which are then invoked at specific points in each record's lifecycle. You can add these callbacks to all record classes, to a particular class, or...

These hooks act like the triggers supported by some databases; you can ensure that every time a record is updated in a specific table, certain other actions occur automatically.

To register a callback, call the install_hooks method, and pass it pairs of a hook method name, and a subroutine reference, as follows: I<callee>->install_hooks( I<methodname> => I<coderef>, ... ).

SQLEngine/Record/Hooks.pm  view on Meta::CPAN

=item install_hooks()

  $classname->install_hooks( $hook_name => \&my_sub, ... )
  $record->install_hooks( $hook_name => \&my_sub, ... )

Registers one or more callbacks. Accepts pairs of a hook method name, and a subroutine reference. 

For more about the implementation of the Hook mechanism, see L<Class::MakeMethods::Composite::Inheritable>.

=back

 view all matches for this distribution


DBIx-Squirrel

 view release on metacpan or  search on metacpan

lib/DBIx/Squirrel/it.pm  view on Meta::CPAN

);
use Sub::Name 'subname';
use DBIx::Squirrel::util qw(
    cluckf
    confessf
    callbacks_args
);
use namespace::clean;

use constant E_BAD_STH   => 'Expected a statement handle object';
use constant E_BAD_SLICE => 'Slice must be a reference to an ARRAY or HASH';

lib/DBIx/Squirrel/it.pm  view on Meta::CPAN


=cut

sub new {
    my $class = ref $_[0] ? ref shift : shift;
    my( $transforms, $sth, @bind_values ) = callbacks_args(@_);
    confessf E_BAD_STH unless UNIVERSAL::isa( $sth, 'DBIx::Squirrel::st' );
    my $self = bless {}, $class;
    $self->_private_state( {
        sth                 => $sth,
        bind_values_initial => [@bind_values],

lib/DBIx/Squirrel/it.pm  view on Meta::CPAN

    *slice_buffer_size = subname( slice_buffer_size => \&slice_cache_size );
}

sub start {
    my( $attr,       $self )        = shift->_private_state;
    my( $transforms, @bind_values ) = callbacks_args(@_);
    if ( @{$transforms} ) {
        $attr->{transforms} = [ @{ $attr->{transforms_initial} }, @{$transforms} ];
    }
    else {
        unless ( defined $attr->{transforms} && @{ $attr->{transforms} } ) {

 view all matches for this distribution


DBIx-Tree

 view release on metacpan or  search on metacpan

Changelog.ini  view on Meta::CPAN

- Fix t/*.t and examples/*.pl to use DBI_DSN, DBI_USER and DBI_PASS
from the environment, if defined, or to default to SQLite.
MySQL is no longer hard-coded anywhere.
- Fix bug where when the constructor call includes both match_data and
start_id, and the id of the match_data is not start_id, then the _do_query()
method would fail to find a record, which meant both the callbacks passed in
to the constructor (method and post_method), if defined, would be called with
an undefined value for $param{item}. This meant the callbacks would be called
one more time that they should have been. This faulty call took place before
any valid call took place.
EOT

[V 1.9]

 view all matches for this distribution


DBIx-TxnPool

 view release on metacpan or  search on metacpan

lib/DBIx/TxnPool.pm  view on Meta::CPAN

server does fsync (data flushing to disk) after each statement. It can be very
slow for many updates. The best solution can be to wrap some
insert/delete/update statements in one transaction for example. But this raises
a new problem - deadlocks. If a deadlock occurs a DBI module throws exceptions
and ideal way to repeat SQL statements again. This module helps to make it. It
has a pool inside for data (FIFO buffer) and calls your callbacks for each
pushed item. When your pool to be fed by your data, it wraps data in one
transaction up to the maximum defined size or up to the finish method. If
deadlock occurs a pool repeats your callbacks for every item again. You can
define a second callback which will be executed for every item after wrapped
transaction. For example there can be non-SQL statements, for example a deleting
files, cleanups and etc.

=head1 CONSTRUCTOR

 view all matches for this distribution


DBIx-Wrapper

 view release on metacpan or  search on metacpan

WhatsNew  view on Meta::CPAN

        * documented reconnect() method
	* update() and smartUpdate() will now ignore (just return a
	  true value) when called with empty $data

Version 0.15
        * Documented callbacks

Version 0.14
        * The data_source argument to connect() can now be a hash
        * Unknown method calls will be passed to the underlying DBI
          object.  So now you can make calls like prepare() which

 view all matches for this distribution


DBIx-glueHTML

 view release on metacpan or  search on metacpan

glueHTML.pm  view on Meta::CPAN


=over 4

=item Future Additions

In a later version, callbacks to add user defined form parameters to 
allow state keeping such as password protection etc.

=item B<set_printheader> B<(>I<Callback function address>B<,> I<Print content type header (1/0)>B<);>

  sub printheader {

 view all matches for this distribution


DB_File

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

   * Added support to allow DB_File to build with Berkeley DB 4.1.X

   * Tightened up the test harness to test that calls to untie don't generate
     the "untie attempted while %d inner references still exist" warning.

   * added code to guard against calling the callbacks (compare,hash & prefix)
     recursively.

   * passing undef for the flags and/or mode when opening a database could cause
     a "Use of uninitialized value in subroutine entry" warning. Now silenced.

Changes  view on Meta::CPAN

1.0

    DB_File has been in use for over a year. To reflect that, the
    version number has been incremented to 1.0.

    Added complete support for multiple concurrent callbacks.

    Using the push method on an empty list didn't work properly. This
    has been fixed.

0.3

    Added prototype support for multiple btree compare callbacks.

0.2

    When DB_File is opening a database file it no longer terminates the
    process if dbopen returned an error. This allows file protection

 view all matches for this distribution


DDC-Concordance

 view release on metacpan or  search on metacpan

ddc-tee.perl  view on Meta::CPAN

  close($fh)
    or die("$prog: close failed for $pidfile: $!");
}

##======================================================================
## callbacks


## undef = cb_client($cli_sock)
sub cb_client {
  my $csock = shift;

 view all matches for this distribution


( run in 0.764 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )