diff --git a/datastore.go b/datastore.go index f534da9..78cc5da 100644 --- a/datastore.go +++ b/datastore.go @@ -95,6 +95,10 @@ func (a *accessor) Has(key ds.Key) (exists bool, err error) { return a.ldb.Has(key.Bytes(), nil) } +func (d *accessor) GetSize(key ds.Key) (size int, err error) { + return ds.GetBackedSize(d, key) +} + func (a *accessor) Delete(key ds.Key) (err error) { // leveldb Delete will not return an error if the key doesn't // exist (see https://github.com/syndtr/goleveldb/issues/109), diff --git a/ds_test.go b/ds_test.go index b7cc2c6..98a7c8b 100644 --- a/ds_test.go +++ b/ds_test.go @@ -9,6 +9,7 @@ import ( ds "github.com/ipfs/go-datastore" dsq "github.com/ipfs/go-datastore/query" + dstest "github.com/ipfs/go-datastore/test" ) var testcases = map[string]string{ @@ -320,3 +321,9 @@ func TestTransactionManyOperations(t *testing.T) { txn.Discard() } + +func TestSuite(t *testing.T) { + d := newDSMem(t) + defer d.Close() + dstest.SubtestAll(t, d) +} diff --git a/package.json b/package.json index bbce025..7bc0820 100644 --- a/package.json +++ b/package.json @@ -21,9 +21,9 @@ }, { "author": "jbenet", - "hash": "QmbQshXLNcCPRUGZv4sBGxnZNAHREA6MKeomkwihNXPZWP", + "hash": "QmaRb5yNXKonhbkpNxNawoydk4N6es6b4fPj19sjEKsh5D", "name": "go-datastore", - "version": "3.3.0" + "version": "3.4.0" } ], "gxVersion": "0.8.0",