|
@ -7,6 +7,7 @@ import ( |
|
|
"github.com/syndtr/goleveldb/leveldb" |
|
|
"github.com/syndtr/goleveldb/leveldb" |
|
|
"github.com/syndtr/goleveldb/leveldb/errors" |
|
|
"github.com/syndtr/goleveldb/leveldb/errors" |
|
|
"github.com/syndtr/goleveldb/leveldb/opt" |
|
|
"github.com/syndtr/goleveldb/leveldb/opt" |
|
|
|
|
|
"github.com/syndtr/goleveldb/leveldb/util" |
|
|
|
|
|
|
|
|
. "github.com/tendermint/tmlibs/common" |
|
|
. "github.com/tendermint/tmlibs/common" |
|
|
) |
|
|
) |
|
@ -119,6 +120,10 @@ func (db *GoLevelDB) Iterator() Iterator { |
|
|
return db.db.NewIterator(nil, nil) |
|
|
return db.db.NewIterator(nil, nil) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (db *GoLevelDB) IteratorPrefix(prefix []byte) Iterator { |
|
|
|
|
|
return db.db.NewIterator(util.BytesPrefix(prefix), nil) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
func (db *GoLevelDB) NewBatch() Batch { |
|
|
func (db *GoLevelDB) NewBatch() Batch { |
|
|
batch := new(leveldb.Batch) |
|
|
batch := new(leveldb.Batch) |
|
|
return &goLevelDBBatch{db, batch} |
|
|
return &goLevelDBBatch{db, batch} |
|
|