mdb(3)

πŸ“¦
version 0.9.35 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

✨ mdb(3) β€” the LMDB API page, but make it make sense πŸ’…

okay bestie, gather round, because this is the mdb(3) page from the Library Functions Manual, and it's literally the doorway to the whole OpenLDAP Lightning Memory-Mapped Database Manager. yes. all of it. she's iconic, she's fast, she's memory-mapped, and we're gonna read her together 🫢


🌈 NAME 🌈

mdb β€” the LMDB API.

That's it. That's the name. She's the OpenLDAP Lightning Memory-Mapped Database Manager and she does not need a long intro, she just is πŸŽ€


✨ SYNOPSIS ✨

πŸ¦‹ Topics πŸ¦‹

the whole little constellation of topics living on this page:

  • Version Macros
  • Environment Flags
  • Database Flags
  • Write Flags

🧚 Data Structures 🧚

  • struct MDB_val β€” a generic structure used for passing keys and data in and out of the database. lowkey the little envelope everything travels in πŸ’Œ

πŸ‘‘ Typedefs πŸ‘‘

  • typedef unsigned int MDB_dbi β€” a handle for an individual database in the DB environment.
  • typedef int MDB_cmp_func(const MDB_val *a, const MDB_val *b) β€” a callback function used to compare two keys in a database.
  • typedef void MDB_rel_func(MDB_val *item, void *oldptr, void *newptr, void *relctx) β€” a callback function used to relocate a position-dependent data item in a fixed-address database.

πŸ’– Detailed Description πŸ’–

OpenLDAP Lightning Memory-Mapped Database Manager.

periodt. that's the vibe, that's the whole thing πŸ’œ


🌸 Data Structure Documentation 🌸

struct MDB_val πŸ“

Generic structure used for passing keys and data in and out of the database.

now pay attention because this part is important, fr fr:

Values returned from the database are valid only until a subsequent update operation, or the end of the transaction. Do not modify or free them β€” they commonly point into the database itself.

so like… those values? not yours. don't touch, don't free, don't get attached 😭

Key sizes must be between 1 and mdb_env_get_maxkeysize() inclusive. The exact same rule applies to data sizes in databases with the MDB_DUPSORT flag. Other data items can in theory be from 0 to 0xffffffff bytes long 🌈

πŸ“¦ Data Fields πŸ“¦

  • size_t mv_size
  • void * mv_data

πŸŽ€ Typedef Documentation πŸŽ€

typedef void MDB_rel_func(MDB_val *item, void *oldptr, void *newptr, void *relctx) πŸ’«

A callback function used to relocate a position-dependent data item in a fixed-address database. Let me break this down bestie:

  • newptr gives the item's desired address in the memory map
  • oldptr gives its previous address
  • the item's actual data resides at the address in item

This callback is expected to walk through the fields of the record in item and modify any values based at the oldptr address to be relative to the newptr address. it's giving ✨relocation era✨

Parameters 🫢

  • item β€” the item that is to be relocated.
  • oldptr β€” the previous address.
  • newptr β€” the new address to relocate to.
  • relctx β€” an application-provided context, set by mdb_set_relctx().

😭 Todo 😭

This feature is currently unimplemented.

so don't come for me, she said what she said πŸ’€


⭐ Author ⭐

Generated automatically by Doxygen for LMDB from the source code.


aaaand that's the whole page, bestie!! πŸ¦‹ this came to you straight from LMDB, wearing her cutest little mdb(3) section-3 library-functions fit, and she ate, no crumbs πŸ’…βœ¨

πŸ“¦ where this page comes from