func (db *DB) Commit(wb *WriteBatch) error { if wb != nil && wb.batch != nil { var errStr *C.char C.rocksdb_write(db.db, db.wOpt, wb.batch, &errStr) C.rocksdb_writebatch_clear(wb.batch) if errStr != nil { defer C.free(unsafe.Pointer(errStr)) return errors.New(C.GoString(errStr)) } } return nil }
// Clear removes all the enqueued Put and Deletes. func (w *WriteBatch) Clear() { C.rocksdb_writebatch_clear(w.c) }
func (w *WriteBatch) Rollback() error { C.rocksdb_writebatch_clear(w.wbatch) return nil }
// Clear removes all the enqueued Put and Deletes. func (self *WriteBatch) Clear() { C.rocksdb_writebatch_clear(self.c) }
func (w *WriteBatch) Rollback() error { if !w.commitOk { C.rocksdb_writebatch_clear(w.wbatch) } return nil }