aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-01-21 15:50:41 -0700
committerBen Johnson <benbjohnson@yahoo.com>2014-01-21 15:50:41 -0700
commitfe89434c0d860ee2930b81092a3abe2fec2dd3c4 (patch)
tree16d5163c345f5738489e157c7bf4314acaf720ed
parentUpdate README.md (diff)
downloaddedo-fe89434c0d860ee2930b81092a3abe2fec2dd3c4.tar.gz
dedo-fe89434c0d860ee2930b81092a3abe2fec2dd3c4.tar.xz
Update README.md
-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.