perl-AnyEvent-MySQL-1.002001-alt1.noarch.rpm


Advertisement

Description

perl-AnyEvent-MySQL - Pure Perl AnyEvent socket implementation of MySQL client

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-AnyEvent-MySQL
Package version 1.002001
Package release alt1
Package architecture noarch
Package type rpm
Installed size 72.17 KB
Download size 72.17 KB
Official Mirror ftp.altlinux.org
This package is used in my company since 2012 to today (2014). I think it should be stable.
(though some data type fetching through prepared command are not implemented)
Please read the test.pl file as a usage example. >w<
use strict;
use warnings;
BEGIN {
eval {
require AE;
require Data::Dumper;
require Devel::StackTrace;
require EV;
};
if( $@ ) {
warn "require module fail: $@";
exit;
}
}
$EV::DIED = sub {
print "EV::DIED: $@\n";
print Devel::StackTrace->new->as_string;
};
use lib 'lib';
use AnyEvent::MySQL;
my $end = AE::cv;
my $dbh = AnyEvent::MySQL->connect("DBI:mysql:database=test;host=127.0.0.1;port=3306", "ptest", "pass", { PrintError => 1 }, sub {
my($dbh) = @_;
if( $dbh ) {
warn "Connect success!";
$dbh->pre_do("set names latin1");
$dbh->pre_do("set names utf8");
}
else {
warn "Connect fail: $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
$end->send;
}
});
$dbh->do("select * from t1 where a<=?", {}, 15, sub {
my $rv = shift;
if( defined($rv) ) {
warn "Do success: $rv";
}
else {
warn "Do fail: $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
}
$end->send;
});
my $end2 = AE::cv;
my $sth = $dbh->prepare("select b, a aaa from t1 where a>?", sub {
warn "prepared!";
$end2->send;
});
my $end3 = AE::cv;
$sth->execute(1, sub {
warn "executed! $_[0]";
$end3->send($_[0]);
});
my $fth = $end3->recv;
my $end4 = AE::cv;
$fth->bind_col(2, \my $a, sub {
warn $_[0];
});
my $fetch; $fetch = sub {
$fth->fetch(sub {
if( $_[0] ) {
warn "Get! $a";
$fetch->();
}
else {
warn "Get End!";
undef $fetch;
$end4->send;
}
});
}; $fetch->();
$end4->recv;
my $end5 = AE::cv;
$dbh->selectall_arrayref("select a*2, b from t1 where a<=?", {}, 15, sub {
warn "selectall_arrayref";
warn Dumper($_[0]);
});
$dbh->selectall_hashref("select a*2, b from t1", 'b', sub {
warn "selectall_hashref";
warn Dumper($_[0]);
});
$dbh->selectall_hashref("select a*2, b from t1", ['b', 'a*2'], sub {
warn "selectall_hashref";
warn Dumper($_[0]);
});
$dbh->selectall_hashref("select a*2, b from t1", sub {
warn "selectall_hashref";
warn Dumper($_[0]);
});
$dbh->selectcol_arrayref("select a*2, b from t1", { Columns => [1,2,1] }, sub {
warn "selectcol_arrayref";
warn Dumper($_[0]);
});
$dbh->selectall_arrayref("select * from t3", sub {
warn "selectall_arrayref t3";
warn Dumper($_[0]);
});
$dbh->selectrow_array("select * from t1 where a>? order by a", {}, 2, sub {
warn "selectrow_array";
warn Dumper(\@_);
});
$dbh->selectrow_arrayref("select * from t1 where a>? order by a", {}, 2, sub {
warn "selectrow_arrayref";
warn Dumper($_[0]);
});
$dbh->selectrow_hashref("select * from t1 where a>? order by a", {}, 2, sub {
warn "selectrow_hashref";
warn Dumper($_[0]);
});
my $st = $dbh->prepare("select * from t1 where a>? order by a");
$st->execute(2, sub {
warn "fetchall_arrayref";
warn Dumper($_[0]->fetchall_arrayref());
});
$st->execute(2, sub {
warn "fetchall_hashref(a)";
warn Dumper($_[0]->fetchall_hashref('a'));
});
$st->execute(2, sub {
warn "fetchall_hashref";
warn Dumper($_[0]->fetchall_hashref());
});
$st->execute(2, sub {
warn "fetchcol_arrayref";
warn Dumper($_[0]->fetchcol_arrayref());
});
$dbh->begin_work( sub {
warn "txn begin.. @_ | $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
} );
$dbh->do("update t1 set a=? b=?", {}, 3, 4, sub {
warn "error update @_ | $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
} );
$dbh->do("update t1 set b=b+1", {}, sub {
warn "after error update @_ | $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
} );
$dbh->commit( sub {
warn "aborted commit @_ | $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
} );
$dbh->do("update t1 set b=b+1", {}, sub {
warn "after aborted commit @_ | $AnyEvent::MySQL::errstr ($AnyEvent::MySQL::err)";
$end5->send;
} );
$end5->recv;
$end->recv;

Alternatives

Package Version Architecture Repository
perl-AnyEvent-MySQL - - -

Requires

Name Value
/usr/share/perl5 -
perl(AE.pm) -
perl(AnyEvent/Handle.pm) -
perl(AnyEvent/Socket.pm) -
perl(Data/Dumper.pm) -
perl(Devel/StackTrace.pm) -
perl(Digest/SHA1.pm) -
perl(Guard.pm) -
perl(List/Util.pm) -
perl(Scalar/Util.pm) -
perl(constant.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(AnyEvent/MySQL.pm) = 1.002.001
perl(AnyEvent/MySQL/Imp.pm) -
perl-AnyEvent-MySQL = 1.002001-alt1

Download

Type URL
Binary Package perl-AnyEvent-MySQL-1.002001-alt1.noarch.rpm
Source Package perl-AnyEvent-MySQL-1.002001-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-AnyEvent-MySQL rpm package:
    # sudo apt-get install perl-AnyEvent-MySQL

Files

Path
/usr/share/doc/perl-AnyEvent-MySQL-1.002001/Changes
/usr/share/doc/perl-AnyEvent-MySQL-1.002001/README
/usr/share/perl5/AnyEvent/MySQL.pm
/usr/share/perl5/AnyEvent/MySQL/Imp.pm

See Also

Package Description
perl-AnyEvent-MySQL-ConnPool-0.07-alt1.noarch.rpm AnyEvent::ConnPool adapter for AnyEvent::MySQL
perl-AnyEvent-Mypeople-Client-0.0.1-alt1.noarch.rpm Mypeople API in an event loop
perl-AnyEvent-Net-Amazon-S3-0.04.0.80-alt1.noarch.rpm Use the Amazon S3 - Simple Storage Service
perl-AnyEvent-Net-Amazon-S3-scripts-0.04.0.80-alt1.noarch.rpm AnyEvent-Net-Amazon-S3 scripts
perl-AnyEvent-Net-Curl-Queued-0.047-alt1.noarch.rpm Moo wrapper for queued downloads via Net::Curl & AnyEvent
perl-AnyEvent-Net-Curl-Queued-scripts-0.047-alt1.noarch.rpm AnyEvent-Net-Curl-Queued scripts
perl-AnyEvent-Net-MPD-0.002-alt1.noarch.rpm A non-blocking interface to MPD
perl-AnyEvent-OWNet-1.163170-alt1.noarch.rpm Client for 1-wire File System server
perl-AnyEvent-Onkyo-1.130220-alt1.noarch.rpm AnyEvent module for controlling Onkyo/Integra AV equipment
perl-AnyEvent-Onkyo-scripts-1.130220-alt1.noarch.rpm AnyEvent-Onkyo scripts
perl-AnyEvent-Open3-Simple-0.86-alt1.noarch.rpm Interface to open3 under AnyEvent
perl-AnyEvent-POE_Reference-0.11-alt1.noarch.rpm AnyEvent talking to POE::Filter::Reference
perl-AnyEvent-PacketForwarder-0.01-alt1.noarch.rpm Forward packets between two sockets
perl-AnyEvent-PacketReader-0.01-alt1.noarch.rpm Read packets from a socket
perl-AnyEvent-Pcap-0.00002-alt1.noarch.rpm Net::Pcap wrapper with AnyEvent
Advertisement
Advertisement