diff options
author | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-24 11:46:58 -0600 |
---|---|---|
committer | Ben Johnson <benbjohnson@yahoo.com> | 2014-03-24 11:46:58 -0600 |
commit | 2bc868c4663468c38aa5d5523138b8837993db8a (patch) | |
tree | f264bf174c0ca41218a9cd40025ab90aeaf56ad4 /cmd/bolt/main.go | |
parent | Merge pull request #87 from benbjohnson/errors (diff) | |
parent | Make DB/Tx API more consistent. (diff) | |
download | dedo-2bc868c4663468c38aa5d5523138b8837993db8a.tar.gz dedo-2bc868c4663468c38aa5d5523138b8837993db8a.tar.xz |
Merge pull request #88 from benbjohnson/tx-rename
Make DB/Tx API more consistent.
Diffstat (limited to 'cmd/bolt/main.go')
-rw-r--r-- | cmd/bolt/main.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd/bolt/main.go b/cmd/bolt/main.go index 647c1c2..9a51ec5 100644 --- a/cmd/bolt/main.go +++ b/cmd/bolt/main.go @@ -66,7 +66,7 @@ func GetCommand(c *cli.Context) { } defer db.Close() - err = db.With(func(tx *bolt.Tx) error { + err = db.View(func(tx *bolt.Tx) error { // Find bucket. b := tx.Bucket(name) if b == nil { @@ -105,7 +105,7 @@ func SetCommand(c *cli.Context) { } defer db.Close() - err = db.Do(func(tx *bolt.Tx) error { + err = db.Update(func(tx *bolt.Tx) error { // Find bucket. b := tx.Bucket(name) if b == nil { @@ -137,7 +137,7 @@ func KeysCommand(c *cli.Context) { } defer db.Close() - err = db.With(func(tx *bolt.Tx) error { + err = db.View(func(tx *bolt.Tx) error { // Find bucket. b := tx.Bucket(name) if b == nil { @@ -172,7 +172,7 @@ func BucketsCommand(c *cli.Context) { } defer db.Close() - err = db.With(func(tx *bolt.Tx) error { + err = db.View(func(tx *bolt.Tx) error { for _, b := range tx.Buckets() { println(b.Name()) } @@ -202,7 +202,7 @@ func PagesCommand(c *cli.Context) { println("ID TYPE ITEMS OVRFLW") println("======== ========== ====== ======") - db.Do(func(tx *bolt.Tx) error { + db.Update(func(tx *bolt.Tx) error { var id int for { p, err := tx.Page(id) |