pub unsafe extern "C" fn mdb_get(
    txn: *mut MDB_txn,
    dbi: MDB_dbi,
    key: *mut MDB_val,
    data: *mut MDB_val
) -> c_int
Expand description

@brief Get items from a database.

This function retrieves key/data pairs from the database. The address and length of the data associated with the specified \b key are returned in the structure to which \b data refers. If the database supports duplicate keys (#MDB_DUPSORT) then the first data item for the key will be returned. Retrieval of other items requires the use of #mdb_cursor_get().

@note The memory pointed to by the returned values is owned by the database. The caller need not dispose of the memory, and may not modify it in any way. For values returned in a read-only transaction any modification attempts will cause a SIGSEGV. @note Values returned from the database are valid only until a subsequent update operation, or the end of the transaction. @param[in] txn A transaction handle returned by #mdb_txn_begin() @param[in] dbi A database handle returned by #mdb_dbi_open() @param[in] key The key to search for in the database @param[out] data The data corresponding to the key @return A non-zero error value on failure and 0 on success. Some possible errors are:

  • #MDB_NOTFOUND - the key was not in the database.
  • EINVAL - an invalid parameter was specified.