File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,17 @@ func (c *Cursor) Bind(txn *Txn, db DBI) error {
9898 return nil
9999}
100100
101+ // Unbind Unbinded cursor is disassociated with any transactions but still holds
102+ // the original DBI-handle internally. Thus, it could be renewed with any running
103+ // transaction or closed.
104+ func (c * Cursor ) Unbind () error {
105+ ret := C .mdbx_cursor_unbind (c ._c )
106+ if ret != success {
107+ return operrno ("mdbx_cursor_unbind" , ret )
108+ }
109+ return nil
110+ }
111+
101112// Close the cursor handle and clear the finalizer on c. Cursors belonging to
102113// write transactions are closed automatically when the transaction is
103114// terminated.
Original file line number Diff line number Diff line change @@ -768,3 +768,11 @@ func (txn *Txn) EnvWarmup(flags uint, timeout time.Duration) error {
768768func (txn * Txn ) CHandle () unsafe.Pointer {
769769 return unsafe .Pointer (txn ._txn )
770770}
771+
772+ func (txn * Txn ) ReleaseAllCursors (unbind bool ) error {
773+ ret := C .mdbx_txn_release_all_cursors (txn ._txn , C .bool (unbind ))
774+ if ret != success {
775+ return operrno ("mdbx_txn_release_all_cursors" , ret )
776+ }
777+ return nil
778+ }
You can’t perform that action at this time.
0 commit comments