Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide safe access to LMDB version #60

Open
martinvonwittich opened this issue Jul 25, 2022 · 0 comments
Open

Provide safe access to LMDB version #60

martinvonwittich opened this issue Jul 25, 2022 · 0 comments

Comments

@martinvonwittich
Copy link

I'm currently playing around with accessing a shared LMDB database from multiple languages (Perl, Python, PHP, Rust, NodeJS), and I'm getting an MDB_VERSION_MISMATCH error in my NodeJS implementation. To further debug this, I tried to determine the LMDB version that each implementation is using, which worked...

  • in NodeJS:

     let lmdb = require('node-lmdb');
     console.log(lmdb.version);
    
  • in Python:

     import lmdb
     print("{}".format(lmdb.version()))
    
  • in Perl:

     use LMDB_File qw(:flags :version);
     printf "%s\n", LMDB_File::MDB_VERSION_STRING;
    
  • in PHP:

     printf("%s\n", dba_handlers(true)["lmdb"]);
    

But I can't find a way to access this information from Rust with the lmdb crate. As far as I can tell, the only way to get it is by using mdb_version from lmdb-sys, but that seems to be unsafe, and as a Rust newbie, I don't dare use it. From the lmdb-sys code it looks like as if the current version is 0.9.21, but that should probably be queryable via code :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant