Exemple #1
0
func (db *DB) NewWriteBatch() *WriteBatch {
	wb := &WriteBatch{
		db:     db,
		wbatch: C.leveldb_writebatch_create(),
	}
	return wb
}
Exemple #2
0
func newWriteBatch(db *DB) *WriteBatch {
	w := new(WriteBatch)
	w.db = db
	w.wbatch = C.leveldb_writebatch_create()
	w.gbatch = new(leveldb.Batch)

	return w
}
Exemple #3
0
func (db *DB) NewWriteBatch() driver.IWriteBatch {
	wb := &WriteBatch{
		db:     db,
		wbatch: C.leveldb_writebatch_create(),
	}

	runtime.SetFinalizer(wb, func(w *WriteBatch) {
		w.Close()
	})
	return wb
}
Exemple #4
0
func New_writebatch() *Writebatch {
	wb := C.leveldb_writebatch_create()
	return &Writebatch{wb}
}