MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / Delete

Method Delete

driver/hybriddb/db.go:218–234  ·  view source on GitHub ↗
(key []byte)

Source from the content-addressed store, hash-verified

216}
217
218func (db *DB) Delete(key []byte) error {
219 db.mu.Lock()
220 defer db.mu.Unlock()
221
222 if db.closed {
223 return fmt.Errorf("database is closed")
224 }
225
226 if len(key) == 0 {
227 db.stats.Errors++
228 return fmt.Errorf("key cannot be empty")
229 }
230
231 db.stats.DeleteOps++
232
233 return db.db.Delete(key, nil)
234}
235
236func (db *DB) SyncPut(key, value []byte) error {
237 db.mu.Lock()

Callers 4

SyncDeleteMethod · 0.45
TestDB_DeleteFunction · 0.45
TestSnapshotFunction · 0.45
TestSnapshot_IteratorFunction · 0.45

Calls

no outgoing calls

Tested by 3

TestDB_DeleteFunction · 0.36
TestSnapshotFunction · 0.36
TestSnapshot_IteratorFunction · 0.36