Beispiel #1
0
func (connection *RocksDbConnection) Delete(options *proto.DbWriteOptions, key []byte) error {
	wo := ratgo.NewWriteOptions()
	defer wo.Close()
	if options != nil {
		wo.SetSync(options.Sync)
		wo.SetDisableWAL(options.DisableWAL)
	}
	return connection.db.Delete(wo, key)
}
Beispiel #2
0
func (connection *RocksDbConnection) Deletes(options *proto.DbWriteOptions, keys [][]byte) error {
	wo := ratgo.NewWriteOptions()
	defer wo.Close()
	if options != nil {
		wo.SetSync(options.Sync)
		wo.SetDisableWAL(options.DisableWAL)
	}
	batch := ratgo.NewWriteBatch()
	defer batch.Close()
	for _, key := range keys {
		batch.Delete(key)
	}
	return connection.db.Write(wo, batch)
}