$db = Paranoid::BerkeleyDB::Db->new( -Env => $env, -Filename => './dbdir/data.db', ); $fn = $db->filename; %params = $db->params; $count = $db->refc; $bdb = $db->dbh;
If you're using the Paranoid::BerkeleyDB(3) API this object is created for you automatically. There is probably no value in using this module directly unless you need to tune BerkeleyDB::Btree's defaults.
Note that you can't have the same db open at the same time with different options. Which ever options were used for the first call is what's in effect since subsequent calls to open the database will simply return cached references.
$db = Paranoid::BerkeleyDB::Db->new( -Env => $env, -Filename => './dbdir/data.db', );
The only required argument is -Filename. For a complete list of all available options please see the BerkeleyDB(3) man page.
By default the following settings are applied unless overridden:
Parameter Value --------------------------------------------------- -Flags DB_CREATE -Mode 0666 &~ umask
If you decided to pass a custom BerkeleyDB environment it needs to be done via Paranoid::BerkeleyDB::Env or it will be ignored.
$fn = $db->filename;
This method returns the canonical path to the specified db file.
%params = $db->params;
This method returns the assembled parameters hash used to open the BerkeleyDB object, minus the environment reference (if passed).
$count = $db->refc;
This method returns the current number of references to the underlying database object. That count is essentially the number of objects all using the same database.
$db = $db->dbh;
This returns a handle to the current BerkeleyDB::Btree(3) object.
L<BerkeleyDB(3)>
(c) 2005 - 2022, Arthur Corliss (corliss@digitalmages.com)
Copyright © 1997 - 2019, Arthur Corliss, all rights reserved.