boltdb/bolt — pull request #57 by benbjohnson (2014-03-01 16:21:05+00:00)
Title: Allow reads of unflushed nodes.

This pull request allows cursors to read updated values from within the RWTransaction. Previously cursors would only read from pages (aka state of the data when the transaction started) but now they can work with nodes as well so they will see updates from within an RWTransaction before they are committed.

Before:

```go
db.Do(func(txn *bolt.RWTransaction) error {
b := txn.Bucket("widgets")
b.Put([]byte("foo"), []byte("bar"))
fmt.Println("The value of foo is: ", string(b.Get([]byte("foo"))))
return nil
})

#=> The value of foo is: nil
```

Now it returns as you'd expect:

```go
db.Do(func(txn *bolt.RWTransaction) error {
b := txn.Bucket("widgets")
b.Put([]byte("foo"), []byte("bar"))
fmt.Println("The value of foo is: ", string(b.Get([]byte("foo"))))
return nil
})

#=> The value of foo is: bar
```

This only affects reads inside of the RWTransaction. Read-only transactions will still consistently read from the pages.