mdb_put(3)

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

πŸ’– mdb_put(3) β€” Write Flags πŸ’–

okay bestie, welcome to the Library Functions Manual, this is the mdb_put page and it's giving flags energy. it's not a function, it's not a program β€” it's a whole lil' vibes-dump of macros and variables that the LMDB docs bundle together under the name mdb_put. let's get into it. πŸ¦‹


✨ NAME ✨

mdb_put β€” Write Flags ✍️

no cap, that's literally it. it's the write flags, the little #defines you sprinkle on your puts and your cursor puts so the database knows what kind of moment you're having.


🌸 SYNOPSIS 🌸

πŸŽ€ Topics

  • Copy Flags β€” yes bestie, there's a whole topic just sitting here called that

πŸŽ€ Macros

these are the icons themselves, verbatim, do not touch:

#define MDB_NOOVERWRITE   0x10
#define MDB_NODUPDATA   0x20
#define MDB_CURRENT   0x40
#define MDB_RESERVE   0x10000
#define MDB_APPEND   0x20000
#define MDB_APPENDDUP   0x40000
#define MDB_MULTIPLE   0x80000

πŸŽ€ Variables

and here's the full roster of struct members that also live on this page for some reason. they didn't get their own page, so they're crashing here:

  • size_t MDB_val::mv_size
  • void * MDB_val::mv_data
  • unsigned int MDB_stat::ms_psize
  • unsigned int MDB_stat::ms_depth
  • size_t MDB_stat::ms_branch_pages
  • size_t MDB_stat::ms_leaf_pages
  • size_t MDB_stat::ms_overflow_pages
  • size_t MDB_stat::ms_entries
  • void * MDB_envinfo::me_mapaddr
  • size_t MDB_envinfo::me_mapsize
  • size_t MDB_envinfo::me_last_pgno
  • size_t MDB_envinfo::me_last_txnid
  • unsigned int MDB_envinfo::me_maxreaders
  • unsigned int MDB_envinfo::me_numreaders

🌈 Detailed Description 🌈

πŸ’œ LMDB Command Line Tools πŸ’œ

so here's the thing β€” this page also shouts out the command line tools that ship with LMDB. here's the whole squad, no one gets left out:

  • mdb_copy β€” environment copy tool πŸ“‹
  • mdb_dump β€” environment export tool πŸ“¦
  • mdb_load β€” environment import tool πŸ“₯
  • mdb_stat β€” environment status tool πŸ“Š

iconic lineup honestly. main character energy across the board.


πŸ’… Macro Definition Documentation πŸ’…

🌟 #define MDB_NOOVERWRITE 0x10

for put: don't write if the key already exists. like, if it's already there, leave it alone, we're not re-doing the bit. πŸ™ˆ

🌟 #define MDB_NODUPDATA 0x20

only for MDB_DUPSORT. okay so there are two moods here:

  • for put: don't write if the key and data pair already exist. same pair = we already have it, don't do it again.
  • for mdb_cursor_del: remove all duplicate data items. all of them. periodt. 🧹

🌟 #define MDB_CURRENT 0x40

for mdb_cursor_put: overwrite the current key/data pair. right here, right now, over the one you're sitting on. πŸ”₯

🌟 #define MDB_RESERVE 0x10000

for put: just reserve space for the data, don't copy it. and it hands you back a pointer to that reserved space so you can go fill it in yourself. it's giving diy. ✨

🌟 #define MDB_APPEND 0x20000

data is being appended, so don't split full pages. πŸ”—

🌟 #define MDB_APPENDDUP 0x40000

duplicate data is being appended, so don't split full pages. 🫢

🌟 #define MDB_MULTIPLE 0x80000

store multiple data items in one single call. only for MDB_DUPFIXED though β€” don't try it elsewhere bestie. πŸ‘‘


πŸ¦‹ Variable Documentation πŸ¦‹

🌸 size_t MDB_val::mv_size

size of the data item πŸ“

🌸 void* MDB_val::mv_data

address of the data item πŸ“

🌸 unsigned int MDB_stat::ms_psize

size of a database page. and yes, this is currently the same for all databases. no favours. ✨

🌸 unsigned int MDB_stat::ms_depth

depth (height) of the B-tree 🌳

🌸 size_t MDB_stat::ms_branch_pages

number of internal (non-leaf) pages πŸ“

🌸 size_t MDB_stat::ms_leaf_pages

number of leaf pages πŸƒ

🌸 size_t MDB_stat::ms_overflow_pages

number of overflow pages 🌊

🌸 size_t MDB_stat::ms_entries

number of data items πŸ”’

🌸 void* MDB_envinfo::me_mapaddr

address of map, if fixed πŸ—ΊοΈ

🌸 size_t MDB_envinfo::me_mapsize

size of the data memory map πŸ“

🌸 size_t MDB_envinfo::me_last_pgno

ID of the last used page πŸ†”

🌸 size_t MDB_envinfo::me_last_txnid

ID of the last committed transaction βœ…

🌸 unsigned int MDB_envinfo::me_maxreaders

max reader slots in the environment 🎟️

🌸 unsigned int MDB_envinfo::me_numreaders

max reader slots used in the environment 🎟️✨


πŸ‘‘ Author πŸ‘‘

generated automatically by Doxygen for LMDB from the source code. the robot did it, i just made it cute. πŸ’–


and that's the whole page bestie, every flag, every struct member, nothing skipped, iykyk 🫢

this lil' rewrite came to you from LMDB β€” the mdb_put(3) page, and that's the version and date situation, fr fr. slay, go write some flags. πŸ’…πŸŒˆβ­

πŸ“¦ where this page comes from