rkv icon indicating copy to clipboard operation
rkv copied to clipboard

prevent applications from opening both named databases and default database

Open mykmelez opened this issue 6 years ago • 1 comments

LMDB stores key-value pairs for named databases in the default database, which makes it dangerous for an application to open both named databases and the default database within the same environment using rkv, as the default database will contain pairs they didn't add, and those pairs cannot be read by rkv (because they aren't formatted the way rkv expects, i.e. by using bincode to serialize Rust values to bytes).

Thus we should prevent applications from opening both named databases and the default database within the same environment via a compile time (ideally) or runtime error.

mykmelez avatar Dec 10 '18 17:12 mykmelez

In #101 I removed the ability to create a default database. This removes that problem. It makes creation a bit more verbose, but it's safer and more general, IMO.

rrichardson avatar Dec 22 '18 08:12 rrichardson