Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lmdb++.h
Original file line number Diff line number Diff line change
Expand Up @@ -1527,6 +1527,19 @@ class lmdb::dbi {
return lmdb::dbi_get(txn, handle(), key, data);
}

/**
* Retrieves a key from this database.
*
* @param txn a transaction handle
* @param key
* @throws lmdb::error on failure
*/
bool get(MDB_txn* const txn,
const val& key) const {
lmdb::val v{};
return lmdb::dbi_get(txn, handle(), key, v);
}

/**
* Retrieves a key from this database.
*
Expand Down Expand Up @@ -1893,6 +1906,16 @@ class lmdb::cursor {
return found;
}

/**
* Removes current key/value pair from this database.
*
* @param flags Allows MDB_NODUPDATA if the database was opened with MDB_DUPSORT
* @throws lmdb::error on failure
*/
void del(const unsigned int flags = 0) {
lmdb::cursor_del(handle(), flags);
}

/**
* Positions this cursor at the given key.
*
Expand Down