tecbot / gorocksdb

gorocksdb is a Go wrapper for RocksDB

Home Page:http://rocksdb.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

WriteBatch.Close

dgryski opened this issue · comments

The docs say:

Batched, atomic writes can be performed with a WriteBatch and DB.Write.

wb := gorocksdb.NewWriteBatch()
// defer wb.Close or use wb.Clear and reuse.
wb.Delete([]byte("foo"))
wb.Put([]byte("foo"), []byte("bar"))
wb.Put([]byte("bar"), []byte("foo"))
err := db.Write(wo, wb)

However, there is no Close method on the WriteBatch type. Is this method missing or is the documentation wrong?

You should try WriteBatch.Destroy.