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

Missing support for MDB_RESERVE in lmdb::dbi::put #16

Open
Julianiolo opened this issue Nov 3, 2024 · 1 comment
Open

Missing support for MDB_RESERVE in lmdb::dbi::put #16

Julianiolo opened this issue Nov 3, 2024 · 1 comment

Comments

@Julianiolo
Copy link

mdb_put supports the MDB_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?

@hoytech
Copy link
Owner

hoytech commented Nov 4, 2024

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!

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

2 participants