35 #define ELECTRONEUM_CURSOR(name) \ 36 struct close_ ## name : ::lmdb::close_cursor {}; \ 37 using name = std::unique_ptr< MDB_cursor, close_ ## name >; 87 return std::unique_ptr<MDB_cursor, D>{cur};
93 using read_txn = std::unique_ptr<MDB_txn, release_read_txn>;
94 using write_txn = std::unique_ptr<MDB_txn, abort_write_txn>;
void mdb_cursor_close(MDB_cursor *cursor)
Close a cursor handle.
expect< std::unique_ptr< MDB_cursor, D > > open_cursor(MDB_txn &txn, MDB_dbi tbl) noexcept
void operator()(MDB_txn *ptr) const noexcept
Lightning memory-mapped database library.
#define ELECTRONEUM_LMDB_CHECK(...)
Executes a LMDB command, and returns errors via lmdb::error enum.
std::unique_ptr< MDB_txn, abort_txn > suspended_txn
std::unique_ptr< MDB_txn, abort_write_txn > write_txn
std::unique_ptr< MDB_txn, release_read_txn > read_txn
struct MDB_txn MDB_txn
Opaque structure for a transaction handle.
unsigned int MDB_dbi
A handle for an individual database in the DB environment.
void mdb_txn_abort(MDB_txn *txn)
Abandon all the operations of the transaction instead of saving them.
struct MDB_cursor MDB_cursor
Opaque structure for navigating through a database.
void operator()(MDB_txn *ptr) const noexcept
void operator()(MDB_cursor *ptr) const noexcept
void operator()(MDB_txn *ptr) const noexcept
int mdb_cursor_open(MDB_txn *txn, MDB_dbi dbi, MDB_cursor **cursor)
Create a cursor handle.