mdb_del function
@brief Delete items from a database.
This function removes key/data pairs from the database.
If the database does not support sorted duplicate data items
(#MDB_DUPSORT) the data parameter is ignored.
If the database supports sorted duplicates and the data parameter
is NULL, all of the duplicate data items for the key will be
deleted. Otherwise, if the data parameter is non-NULL
only the matching data item will be deleted.
This function will return #MDB_NOTFOUND if the specified key/data
pair is not in the database.
@paramin
txn A transaction handle returned by #mdb_txn_begin()
@paramin
dbi A database handle returned by #mdb_dbi_open()
@paramin
key The key to delete from the database
@paramin
data The data to delete
@return A non-zero error value on failure and 0 on success. Some possible
errors are:
- EACCES - an attempt was made to write in a read-only transaction.
- EINVAL - an invalid parameter was specified.
Implementation
@ffi.FfiNative<
ffi.Int Function(ffi.Pointer<MDB_txn>, MDB_dbi, ffi.Pointer<MDB_val>,
ffi.Pointer<MDB_val>)>('mdb_del')
external int mdb_del(
ffi.Pointer<MDB_txn> txn,
int dbi,
ffi.Pointer<MDB_val> key,
ffi.Pointer<MDB_val> data,
);