func (s *DB) Get(bucketName string, key interface{}, to interface{}) error {
	return s.root.Get(bucketName, key, to)
}
Get a value from a bucket
package storm
import (
	"bytes"
	"encoding/binary"
	"os"
	"time"
	"github.com/asdine/storm/codec"
	"github.com/asdine/storm/codec/json"
	"github.com/asdine/storm/index"
	"github.com/asdine/storm/q"
	"github.com/boltdb/bolt"
)
const (
	dbinfo         = "__storm_db"
	metadataBucket = "__storm_metadata"
)
var defaultCodec = json.Codec
func Open(path string, stormOptions ...func(*DB) error) (*DB, error) {
	var err error
	s := &DB{
		Path:  path,
		codec: defaultCodec,
	}
	for _, option := range stormOptions {
		if err = option(s); err != nil {
			return nil, err
		}
	}
	if s.boltMode == 0 {
		s.boltMode = 0600
	}
	if s.boltOptions == nil {
		s.boltOptions = &bolt.Options{Timeout: 1 * time.Second}
	}
	s.root = &node{s: s, rootBucket: s.rootBucket, codec: s.codec, batchMode: s.batchMode}
	if s.Bolt == nil {
		s.Bolt, err = bolt.Open(path, s.boltMode, s.boltOptions)
		if err != nil {
			return nil, err
		}
		err = s.checkVersion()
		if err != nil {
			return nil, err
		}
	}
	return s, nil
}
type DB struct {
	Path string
	codec codec.MarshalUnmarshaler
	Bolt *bolt.DB
	boltMode os.FileMode
	boltOptions *bolt.Options
	autoIncrement bool
	root *node
	rootBucket []string
	batchMode bool
}
func (s *DB) From(root ...string) Node {
	newNode := *s.root
	newNode.rootBucket = root
	return &newNode
}
func (s *DB) WithTransaction(tx *bolt.Tx) Node {
	return s.root.WithTransaction(tx)
}
func (s *DB) Bucket() []string {
	return s.root.Bucket()
}
func (s *DB) Close() error {
	return s.Bolt.Close()
}
func (s *DB) Codec() codec.MarshalUnmarshaler {
	return s.codec
}
func (s *DB) WithCodec(codec codec.MarshalUnmarshaler) Node {
	n := s.From().(*node)
	n.codec = codec
	return n
}
func (s *DB) WithBatch(enabled bool) Node {
	n := s.From().(*node)
	n.batchMode = enabled
	return n
}