Data-Downloader

 view release on metacpan or  search on metacpan

lib/Data/Downloader/DB.pm  view on Meta::CPAN

    my $class = shift;
    # See Rose::DB -- this is the recommended way to cache db handles.
    my $dbh = DBI->connect_cached(@_);
    $dbh->do("PRAGMA synchronous = OFF");
    $dbh->do("PRAGMA foreign_keys = ON") unless $ENV{DATA_DOWNLOADER_BULK_DOWNLOAD};
    $dbh->do("PRAGMA count_changes = OFF");
    if (my $mode = $ENV{DATA_DOWNLOADER_JOURNAL_MODE}) {
	$dbh->do("PRAGMA journal_mode = $mode")
	    if (grep $_ eq $mode, qw(DELETE TRUNCATE PERSIST MEMORY WAL OFF));
    }
    $dbh->sqlite_busy_timeout(1000*300);  # wait up to 5 minutes if it is locked
    return $dbh;
}

=item simple

Returns a L<DBIx::Simple|DBIx::Simple> object, for when the ORM is not enough.

=cut

sub simple {



( run in 0.774 second using v1.01-cache-2.11-cpan-49f99fa48dc )