diff --git a/lmdb++.h b/lmdb++.h index 601568c..3ff607e 100644 --- a/lmdb++.h +++ b/lmdb++.h @@ -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. * @@ -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. *