mdbx: добавление mdbx_cursor_unbind() в API.

This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2023-10-13 17:36:21 +03:00
parent 5f274eb4c6
commit d28a397b2d
3 changed files with 68 additions and 25 deletions

View File

@@ -4223,6 +4223,9 @@ public:
/// map handle.
inline void bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle);
/// \brief Unbind cursor from a transaction.
inline void unbind();
/// \brief Returns the cursor's transaction.
inline ::mdbx::txn txn() const;
inline map_handle map() const;
@@ -6110,6 +6113,10 @@ inline void cursor::bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle) {
error::success_or_throw(::mdbx_cursor_bind(txn, handle_, map_handle.dbi));
}
inline void cursor::unbind() {
error::success_or_throw(::mdbx_cursor_unbind(handle_));
}
inline txn cursor::txn() const {
MDBX_txn *txn = ::mdbx_cursor_txn(handle_);
error::throw_on_nullptr(txn, MDBX_EINVAL);