danburkert / lmdb-rs

Safe Rust bindings for LMDB
Apache License 2.0
172 stars 87 forks source link

Provide safe access to LMDB version #60

Open martinvonwittich opened 2 years ago

martinvonwittich commented 2 years ago

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...

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 :)