aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md74
1 files changed, 43 insertions, 31 deletions
diff --git a/README.md b/README.md
index 7c61360..3168023 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-bolt
+Bolt
====
## Overview
@@ -23,36 +23,6 @@ err := db.Close()
```
-### Buckets
-
-Buckets are where your actual key/value data gets stored.
-You can create new buckets from the database and look them up by name.
-
-#### Creating a bucket
-
-```go
-b, err := db.CreateBucket("widgets")
-```
-
-#### Retrieve an existing bucket
-
-```go
-b, err := db.Bucket("widgets")
-```
-
-#### Retrieve a list of all buckets
-
-```go
-buckets, err := db.Buckets()
-```
-
-#### Deleting a bucket
-
-```go
-err := db.DeleteBucket("widgets")
-```
-
-
### Transactions
Versioning of data in the bucket data happens through a Transaction.
@@ -87,6 +57,48 @@ err := t.Abort()
```
+### Buckets
+
+Buckets are where your actual key/value data gets stored.
+You can create new buckets from the database and look them up by name.
+
+#### Creating a bucket
+
+```go
+t, err := db.RWTransaction()
+err := t.CreateBucket("widgets")
+```
+
+#### Renaming a bucket
+
+```go
+t, err := db.RWTransaction()
+err := t.RenameBucket("widgets", "woojits")
+```
+
+#### Deleting a bucket
+
+```go
+t, err := db.RWTransaction()
+err := t.DeleteBucket("widgets")
+```
+
+#### Retrieve an existing bucket
+
+```go
+t, err := db.Transaction()
+b, err := t.Bucket("widgets")
+```
+
+#### Retrieve a list of all buckets
+
+```go
+t, err := db.Transaction()
+buckets, err := db.Buckets()
+```
+
+
+
### Cursors
Cursors provide access to a specific bucket within a transaction.