func (txn *Txn) Del(dbi DBI, key, val []byte) error { ckey := Wrap(key) if val == nil { ret := C.mdb_del(txn._txn, C.MDB_dbi(dbi), (*C.MDB_val)(&ckey), nil) return errno(ret) } cval := Wrap(val) ret := C.mdb_del(txn._txn, C.MDB_dbi(dbi), (*C.MDB_val)(&ckey), (*C.MDB_val)(&cval)) return errno(ret) }
func (txn *Txn) Del(dbi DBI, key, val []byte) error { ckey := Wrap(key) defer ckey.Free() var cval *Val if val != nil { cval = Wrap(val) defer cval.Free() } ret := C.mdb_del(txn.txn, C.MDB_dbi(dbi), (*C.MDB_val)(ckey), (*C.MDB_val)(cval)) return errno(ret) }
func (txn *Txn) Del(dbi DBI, key, val []byte) error { ckey := &C.MDB_val{mv_size: C.size_t(len(key)), mv_data: unsafe.Pointer(&key[0])} var cval *C.MDB_val if val == nil { cval = nil } else { cval = &C.MDB_val{mv_size: C.size_t(len(val)), mv_data: unsafe.Pointer(&val[0])} } ret := C.mdb_del(txn._txn, C.MDB_dbi(dbi), ckey, cval) if ret != SUCCESS { return Errno(ret) } return nil }