aboutsummaryrefslogtreecommitdiff
path: root/tx.go
diff options
context:
space:
mode:
Diffstat (limited to 'tx.go')
-rw-r--r--tx.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/tx.go b/tx.go
index 5844ffe..612f493 100644
--- a/tx.go
+++ b/tx.go
@@ -75,6 +75,14 @@ func (tx *Tx) Writable() bool {
return tx.writable
}
+// Cursor creates a cursor associated with the root bucket.
+// All items in the cursor will return a nil value because all root bucket keys point to buckets.
+// The cursor is only valid as long as the transaction is open.
+// Do not use a cursor after the transaction is closed.
+func (tx *Tx) Cursor() *Cursor {
+ return tx.root.Cursor()
+}
+
// Stats retrieves a copy of the current transaction statistics.
func (tx *Tx) Stats() TxStats {
return tx.stats