DBM-Deep

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/44_upgrade_db.t
t/45_references.t
t/46_blist_reindex.t
t/47_odd_reference_behaviors.t
t/48_autoexport_after_delete.t
t/50_deletes.t
t/52_memory_leak.t
t/53_misc_transactions.t
t/54_output_punct_vars.t
t/55_recursion.t
t/56_unicode.t
t/57_old_db.t
t/58_cache.t
t/96_virtual_functions.t
t/97_dump_file.t
t/98_pod.t
t/99_pod_coverage.t
t/common.pm
t/etc/db-0-983
t/etc/db-0-99_04
t/etc/db-1-0000

README  view on Meta::CPAN

        These are the transactional functions. "TRANSACTIONS" for more
        information.

    *   supports( $option )

        This returns a boolean indicating whether this instance of DBM::Deep
        supports that feature. $option can be one of:

        *   transactions

        *   unicode

    *   db_version()

        This returns the version of the database format that the current
        database is in. This is specified as the earliest version of
        DBM::Deep that supports it.

        For the File back end, this will be 1.0003 or 2.

        For the DBI back end, it is currently always 1.0020.

lib/DBM/Deep.pod  view on Meta::CPAN

X<supports>

This returns a boolean indicating whether this instance of DBM::Deep
supports that feature. C<$option> can be one of:

=over 4

=item * transactions
X<translation>

=item * unicode
X<unicode>

=back

=item * db_version()
X<db_version>

This returns the version of the database format that the current database
is in. This is specified as the earliest version of DBM::Deep that supports
it.

lib/DBM/Deep/Engine/File.pm  view on Meta::CPAN

sub set_chains_loc { $_[0]{chains_loc} = $_[1] }

sub supports {
    my $self = shift;
    my ($feature) = @_;

    if ( $feature eq 'transactions' ) {
        return $self->num_txns > 1;
    }
    return 1 if $feature eq 'singletons';
    return 1 if $feature eq 'unicode';
    return;
}

sub db_version {
    return $_[0]{v} == 3 ? '1.0003' : 2;
}

sub clear {
    my $self = shift;
    my $obj = shift;

t/56_unicode.t  view on Meta::CPAN

use utf8;

use DBM::Deep;

my $dbm_factory = new_dbm();
while ( my $dbm_maker = $dbm_factory->() ) {
    my $db = $dbm_maker->();

    SKIP: {
       skip "This engine does not support Unicode", 1
         unless $db->supports( 'unicode' );

       my $quote
        = 'Ἐγένετο δὲ λόγῳ μὲν δημοκρατία, λόγῳ δὲ τοῦ πρώτου ἀνδρὸς ἀρχή.'
          .' —Θουκυδίδης';

       $db->{'тэкст'} = $quote;
       is join("-", keys %$db), 'тэкст', 'Unicode keys';
       is $db->{'тэкст'}, $quote, 'Unicode values';

       {



( run in 0.629 second using v1.01-cache-2.11-cpan-88abd93f124 )