AnyEvent-DBI-Abstract
view release on metacpan or search on metacpan
use Test::More;
use Test::Requires qw(DBD::SQLite);
use AnyEvent::DBI::Abstract;
sub sync(&;&) {
my $block = shift;
my $cb = shift;
my $cv = AnyEvent->condvar;
$cv->cb(sub { $cb->($_[0]->recv) }) if $cb;
$block->($cv);
$cv->recv;
}
my $dbh = AnyEvent::DBI::Abstract->new("dbi:SQLite:dbname=t/test.db", "", "");
sync { $dbh->exec("create table foo (id integer, foo text)", @_) };
( run in 0.924 second using v1.01-cache-2.11-cpan-49f99fa48dc )