danburkert / lmdb-rs

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

Add support for MDB_MULTIPLE #20

Open fbernier opened 7 years ago

fbernier commented 7 years ago

Hi,

I tried hacking around a little a while ago to add support for the MDB_MULTIPLE insert flag on mdb_cursor_put but failed. Here's my (maybe outdated) dirty branch: https://github.com/danburkert/lmdb-rs/compare/master...fbernier:mdb_multiple

The problem I was having is that is seems like what I'm getting back when reading is the pointer to the data and not the data itself.

I am opening this issue because I kind of gave up but feel like it would be a worthy addition.

If I understand correctly, one of the problems with implementing multiple insert is that the data needs to be sequential. If it's not, we can still use it by copying the data but I guess it defeats the purpose.