salortiz / LMDB_File

Perl wrapper around the OpenLDAP's LMDB
Other
8 stars 12 forks source link

Cannot assign LMDB::Txn->new() to $DB->Txn #23

Open akotlar opened 7 years ago

akotlar commented 7 years ago

Documentation states $DB->Txn can be used as lvalue. This works when assigning $Env->BeginTxn() but not when assigning LMDB::Txn->new(). $DB->Txn is undef in the latter case.

I think this is part of the larger general issue of documentation (#22). We have low-level methods, but there are few examples (and few tests) for their use. The low-level API is also incomplete, with no direct access to Cursor (./t/04-bigone.t shows how to use the underlying _get method, which is undocumented, but no ability to use Cursor outside of LMDB_File objects).

I think it would be more idiomatic to have access to mdb_* methods. They are already present in the XS package. Is there any way to use them directly? If not, would it be hard to expose them?