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

problem in lmdb++.h line 1654 #30

Open
vivipac opened this issue Nov 30, 2022 · 1 comment
Open

problem in lmdb++.h line 1654 #30

vivipac opened this issue Nov 30, 2022 · 1 comment
Labels

Comments

@vivipac
Copy link

vivipac commented Nov 30, 2022

in lmdb::dbi_put there is no way to put an element like :
int data[10]
lmdb::val lmdbData((void*)data, sizeof(int)*10 );
...
dbi.put(wtxn, "data", lmdbData))

@vivipac vivipac added the bug label Nov 30, 2022
@hoytech
Copy link

hoytech commented Dec 2, 2022

Hi! I see you solved your initial problem and edited your post. As you discovered, the issue was the problematic template overloads provided by this library. Many people have tripped over this same issue, which is why I have removed them in my fork:

https://github.com/hoytech/lmdbxx

If I understand, your bug report is now suggesting adding an overload of put(txn, const char *, lmdb::val &) ? You could submit a PR for this, but this library is currently not maintained.

If you want to use my fork, something like this should work:

int data[10];
dbi.put(wtxn, "data", std::string_view((const char*)data, sizeof(data)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants