Open Julianiolo opened 1 week ago
Good point! None of my applications use MDB_RESERVE
so I haven't had a need to solve this yet.
I think I would favour being explicit about this and adding a new method, but I haven't thought about it much yet. Pull requests welcome!
mdb_put
supports theMDB_RESERVE
flag which allows a user to insert a value without any actual data. The function then returns the space for the user to write to via the data parameter. (see).lmdb::dbi::put however uses a
std::string_view data
for its data parameter, so the allocated space cannot be handed back to the user. (so this is also an API problem)I'm not sure on how this should be handled, as changing it to
std::string_view& data
would certainly break code? Maybe an extra method or overload would be good?