gorocksdb icon indicating copy to clipboard operation
gorocksdb copied to clipboard

WriteBatch.Close

Open dgryski opened this issue 6 years ago • 1 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?

dgryski avatar Jun 09 '18 04:06 dgryski

You should try WriteBatch.Destroy.

flier avatar Mar 19 '21 08:03 flier