mdbxmou 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/.github/workflows/ci.yml +32 -0
  2. package/.github/workflows/publish.yml +27 -0
  3. package/.gitmodules +3 -0
  4. package/CMakeLists.txt +53 -0
  5. package/LICENSE +201 -0
  6. package/README.md +639 -0
  7. package/build.js +11 -0
  8. package/deps/libmdbx/.clang-format +3 -0
  9. package/deps/libmdbx/.cmake-format.yaml +3 -0
  10. package/deps/libmdbx/.le.ini +40 -0
  11. package/deps/libmdbx/CMakeLists.txt +1269 -0
  12. package/deps/libmdbx/COPYRIGHT +159 -0
  13. package/deps/libmdbx/ChangeLog.md +2786 -0
  14. package/deps/libmdbx/GNUmakefile +950 -0
  15. package/deps/libmdbx/LICENSE +177 -0
  16. package/deps/libmdbx/Makefile +16 -0
  17. package/deps/libmdbx/NOTICE +39 -0
  18. package/deps/libmdbx/README.md +863 -0
  19. package/deps/libmdbx/TODO.md +43 -0
  20. package/deps/libmdbx/cmake/compiler.cmake +1221 -0
  21. package/deps/libmdbx/cmake/profile.cmake +58 -0
  22. package/deps/libmdbx/cmake/utils.cmake +524 -0
  23. package/deps/libmdbx/conanfile.py +323 -0
  24. package/deps/libmdbx/docs/Doxyfile.in +2734 -0
  25. package/deps/libmdbx/docs/_preface.md +47 -0
  26. package/deps/libmdbx/docs/_restrictions.md +248 -0
  27. package/deps/libmdbx/docs/_starting.md +245 -0
  28. package/deps/libmdbx/docs/_toc.md +34 -0
  29. package/deps/libmdbx/docs/header.html +96 -0
  30. package/deps/libmdbx/example/CMakeLists.txt +6 -0
  31. package/deps/libmdbx/example/README.md +1 -0
  32. package/deps/libmdbx/example/example-mdbx.c +154 -0
  33. package/deps/libmdbx/example/sample-bdb.txt +77 -0
  34. package/deps/libmdbx/mdbx.h +6655 -0
  35. package/deps/libmdbx/mdbx.h++ +6428 -0
  36. package/deps/libmdbx/packages/buildroot/0001-package-libmdbx-new-package-library-database.patch +173 -0
  37. package/deps/libmdbx/src/alloy.c +54 -0
  38. package/deps/libmdbx/src/api-cold.c +543 -0
  39. package/deps/libmdbx/src/api-copy.c +912 -0
  40. package/deps/libmdbx/src/api-cursor.c +754 -0
  41. package/deps/libmdbx/src/api-dbi.c +315 -0
  42. package/deps/libmdbx/src/api-env.c +1434 -0
  43. package/deps/libmdbx/src/api-extra.c +165 -0
  44. package/deps/libmdbx/src/api-key-transform.c +197 -0
  45. package/deps/libmdbx/src/api-misc.c +286 -0
  46. package/deps/libmdbx/src/api-opts.c +575 -0
  47. package/deps/libmdbx/src/api-range-estimate.c +365 -0
  48. package/deps/libmdbx/src/api-txn-data.c +454 -0
  49. package/deps/libmdbx/src/api-txn.c +921 -0
  50. package/deps/libmdbx/src/atomics-ops.h +364 -0
  51. package/deps/libmdbx/src/atomics-types.h +97 -0
  52. package/deps/libmdbx/src/audit.c +109 -0
  53. package/deps/libmdbx/src/bits.md +34 -0
  54. package/deps/libmdbx/src/chk.c +1796 -0
  55. package/deps/libmdbx/src/cogs.c +309 -0
  56. package/deps/libmdbx/src/cogs.h +506 -0
  57. package/deps/libmdbx/src/coherency.c +170 -0
  58. package/deps/libmdbx/src/config.h.in +88 -0
  59. package/deps/libmdbx/src/cursor.c +2396 -0
  60. package/deps/libmdbx/src/cursor.h +391 -0
  61. package/deps/libmdbx/src/dbi.c +717 -0
  62. package/deps/libmdbx/src/dbi.h +142 -0
  63. package/deps/libmdbx/src/debug_begin.h +36 -0
  64. package/deps/libmdbx/src/debug_end.h +15 -0
  65. package/deps/libmdbx/src/dpl.c +486 -0
  66. package/deps/libmdbx/src/dpl.h +134 -0
  67. package/deps/libmdbx/src/dxb.c +1335 -0
  68. package/deps/libmdbx/src/env.c +607 -0
  69. package/deps/libmdbx/src/essentials.h +125 -0
  70. package/deps/libmdbx/src/gc-get.c +1345 -0
  71. package/deps/libmdbx/src/gc-put.c +970 -0
  72. package/deps/libmdbx/src/gc.h +40 -0
  73. package/deps/libmdbx/src/global.c +474 -0
  74. package/deps/libmdbx/src/internals.h +585 -0
  75. package/deps/libmdbx/src/layout-dxb.h +288 -0
  76. package/deps/libmdbx/src/layout-lck.h +289 -0
  77. package/deps/libmdbx/src/lck-posix.c +859 -0
  78. package/deps/libmdbx/src/lck-windows.c +607 -0
  79. package/deps/libmdbx/src/lck.c +174 -0
  80. package/deps/libmdbx/src/lck.h +110 -0
  81. package/deps/libmdbx/src/logging_and_debug.c +250 -0
  82. package/deps/libmdbx/src/logging_and_debug.h +159 -0
  83. package/deps/libmdbx/src/man1/mdbx_chk.1 +106 -0
  84. package/deps/libmdbx/src/man1/mdbx_copy.1 +95 -0
  85. package/deps/libmdbx/src/man1/mdbx_drop.1 +48 -0
  86. package/deps/libmdbx/src/man1/mdbx_dump.1 +101 -0
  87. package/deps/libmdbx/src/man1/mdbx_load.1 +105 -0
  88. package/deps/libmdbx/src/man1/mdbx_stat.1 +86 -0
  89. package/deps/libmdbx/src/mdbx.c++ +1837 -0
  90. package/deps/libmdbx/src/meta.c +656 -0
  91. package/deps/libmdbx/src/meta.h +168 -0
  92. package/deps/libmdbx/src/mvcc-readers.c +414 -0
  93. package/deps/libmdbx/src/node.c +365 -0
  94. package/deps/libmdbx/src/node.h +102 -0
  95. package/deps/libmdbx/src/ntdll.def +1246 -0
  96. package/deps/libmdbx/src/options.h +534 -0
  97. package/deps/libmdbx/src/osal.c +3485 -0
  98. package/deps/libmdbx/src/osal.h +587 -0
  99. package/deps/libmdbx/src/page-get.c +483 -0
  100. package/deps/libmdbx/src/page-iov.c +185 -0
  101. package/deps/libmdbx/src/page-iov.h +34 -0
  102. package/deps/libmdbx/src/page-ops.c +744 -0
  103. package/deps/libmdbx/src/page-ops.h +142 -0
  104. package/deps/libmdbx/src/pnl.c +236 -0
  105. package/deps/libmdbx/src/pnl.h +146 -0
  106. package/deps/libmdbx/src/preface.h +990 -0
  107. package/deps/libmdbx/src/proto.h +105 -0
  108. package/deps/libmdbx/src/refund.c +212 -0
  109. package/deps/libmdbx/src/sort.h +484 -0
  110. package/deps/libmdbx/src/spill.c +431 -0
  111. package/deps/libmdbx/src/spill.h +74 -0
  112. package/deps/libmdbx/src/table.c +107 -0
  113. package/deps/libmdbx/src/tls.c +551 -0
  114. package/deps/libmdbx/src/tls.h +43 -0
  115. package/deps/libmdbx/src/tools/chk.c +673 -0
  116. package/deps/libmdbx/src/tools/copy.c +166 -0
  117. package/deps/libmdbx/src/tools/drop.c +199 -0
  118. package/deps/libmdbx/src/tools/dump.c +515 -0
  119. package/deps/libmdbx/src/tools/load.c +831 -0
  120. package/deps/libmdbx/src/tools/stat.c +516 -0
  121. package/deps/libmdbx/src/tools/wingetopt.c +87 -0
  122. package/deps/libmdbx/src/tools/wingetopt.h +30 -0
  123. package/deps/libmdbx/src/tree-ops.c +1554 -0
  124. package/deps/libmdbx/src/tree-search.c +140 -0
  125. package/deps/libmdbx/src/txl.c +99 -0
  126. package/deps/libmdbx/src/txl.h +26 -0
  127. package/deps/libmdbx/src/txn.c +1083 -0
  128. package/deps/libmdbx/src/unaligned.h +205 -0
  129. package/deps/libmdbx/src/utils.c +32 -0
  130. package/deps/libmdbx/src/utils.h +76 -0
  131. package/deps/libmdbx/src/version.c.in +44 -0
  132. package/deps/libmdbx/src/walk.c +290 -0
  133. package/deps/libmdbx/src/walk.h +20 -0
  134. package/deps/libmdbx/src/windows-import.c +152 -0
  135. package/deps/libmdbx/src/windows-import.h +128 -0
  136. package/deps/libmdbx/test/CMakeLists.txt +317 -0
  137. package/deps/libmdbx/test/append.c++ +237 -0
  138. package/deps/libmdbx/test/base.h++ +92 -0
  139. package/deps/libmdbx/test/battery-tmux.sh +64 -0
  140. package/deps/libmdbx/test/cases.c++ +118 -0
  141. package/deps/libmdbx/test/chrono.c++ +134 -0
  142. package/deps/libmdbx/test/chrono.h++ +85 -0
  143. package/deps/libmdbx/test/config.c++ +643 -0
  144. package/deps/libmdbx/test/config.h++ +334 -0
  145. package/deps/libmdbx/test/copy.c++ +62 -0
  146. package/deps/libmdbx/test/dead.c++ +39 -0
  147. package/deps/libmdbx/test/dump-load.sh +40 -0
  148. package/deps/libmdbx/test/extra/crunched_delete.c++ +409 -0
  149. package/deps/libmdbx/test/extra/cursor_closing.c++ +410 -0
  150. package/deps/libmdbx/test/extra/dbi.c++ +229 -0
  151. package/deps/libmdbx/test/extra/doubtless_positioning.c++ +253 -0
  152. package/deps/libmdbx/test/extra/dupfix_addodd.c +94 -0
  153. package/deps/libmdbx/test/extra/dupfix_multiple.c++ +311 -0
  154. package/deps/libmdbx/test/extra/early_close_dbi.c++ +137 -0
  155. package/deps/libmdbx/test/extra/hex_base64_base58.c++ +118 -0
  156. package/deps/libmdbx/test/extra/maindb_ordinal.c++ +61 -0
  157. package/deps/libmdbx/test/extra/open.c++ +96 -0
  158. package/deps/libmdbx/test/extra/pcrf/README.md +2 -0
  159. package/deps/libmdbx/test/extra/pcrf/pcrf_test.c +380 -0
  160. package/deps/libmdbx/test/extra/probe.c++ +10 -0
  161. package/deps/libmdbx/test/extra/txn.c++ +407 -0
  162. package/deps/libmdbx/test/extra/upsert_alldups.c +193 -0
  163. package/deps/libmdbx/test/fork.c++ +263 -0
  164. package/deps/libmdbx/test/hill.c++ +447 -0
  165. package/deps/libmdbx/test/jitter.c++ +197 -0
  166. package/deps/libmdbx/test/keygen.c++ +393 -0
  167. package/deps/libmdbx/test/keygen.h++ +130 -0
  168. package/deps/libmdbx/test/log.c++ +358 -0
  169. package/deps/libmdbx/test/log.h++ +91 -0
  170. package/deps/libmdbx/test/main.c++ +706 -0
  171. package/deps/libmdbx/test/nested.c++ +318 -0
  172. package/deps/libmdbx/test/osal-unix.c++ +647 -0
  173. package/deps/libmdbx/test/osal-windows.c++ +440 -0
  174. package/deps/libmdbx/test/osal.h++ +41 -0
  175. package/deps/libmdbx/test/stochastic.sh +690 -0
  176. package/deps/libmdbx/test/stub/LICENSE +24 -0
  177. package/deps/libmdbx/test/stub/README.md +8 -0
  178. package/deps/libmdbx/test/stub/pthread_barrier.c +104 -0
  179. package/deps/libmdbx/test/stub/pthread_barrier.h +77 -0
  180. package/deps/libmdbx/test/test.c++ +1551 -0
  181. package/deps/libmdbx/test/test.h++ +298 -0
  182. package/deps/libmdbx/test/tmux.conf +3 -0
  183. package/deps/libmdbx/test/try.c++ +30 -0
  184. package/deps/libmdbx/test/ttl.c++ +240 -0
  185. package/deps/libmdbx/test/utils.c++ +203 -0
  186. package/deps/libmdbx/test/utils.h++ +326 -0
  187. package/deps/libmdbx/test/valgrind_suppress.txt +536 -0
  188. package/lib/mdbx_evn_async.js +211 -0
  189. package/lib/mdbx_worker.js +195 -0
  190. package/lib/nativemou.js +6 -0
  191. package/package.json +38 -0
  192. package/src/async/envmou_close.cpp +34 -0
  193. package/src/async/envmou_close.hpp +32 -0
  194. package/src/async/envmou_copy_to.cpp +29 -0
  195. package/src/async/envmou_copy_to.hpp +38 -0
  196. package/src/async/envmou_keys.cpp +201 -0
  197. package/src/async/envmou_keys.hpp +50 -0
  198. package/src/async/envmou_open.cpp +38 -0
  199. package/src/async/envmou_open.hpp +33 -0
  200. package/src/async/envmou_query.cpp +167 -0
  201. package/src/async/envmou_query.hpp +53 -0
  202. package/src/dbimou.cpp +522 -0
  203. package/src/dbimou.hpp +82 -0
  204. package/src/env_arg0.hpp +24 -0
  205. package/src/envmou.cpp +445 -0
  206. package/src/envmou.hpp +116 -0
  207. package/src/modulemou.cpp +113 -0
  208. package/src/querymou.cpp +177 -0
  209. package/src/querymou.hpp +93 -0
  210. package/src/txnmou.cpp +254 -0
  211. package/src/txnmou.hpp +122 -0
  212. package/src/typemou.hpp +239 -0
  213. package/src/valuemou.hpp +194 -0
  214. package/test/async.js +67 -0
  215. package/test/e3.js +38 -0
  216. package/test/e4.js +89 -0
  217. package/test/e5.js +162 -0
  218. package/test/test-batch-ops.js +243 -0
  219. package/test/test-cursor-mode.js +84 -0
  220. package/test/test-multi-mode.js +87 -0
@@ -0,0 +1,159 @@
1
+ /// \copyright SPDX-License-Identifier: Apache-2.0
2
+ /// \author Леонид Юрьев aka Leonid Yuriev <leo@yuriev.ru> \date 2015-2025
3
+
4
+ #pragma once
5
+
6
+ #include "essentials.h"
7
+
8
+ #ifndef __Wpedantic_format_voidptr
9
+ MDBX_MAYBE_UNUSED static inline const void *__Wpedantic_format_voidptr(const void *ptr) { return ptr; }
10
+ #define __Wpedantic_format_voidptr(ARG) __Wpedantic_format_voidptr(ARG)
11
+ #endif /* __Wpedantic_format_voidptr */
12
+
13
+ MDBX_INTERNAL void MDBX_PRINTF_ARGS(4, 5) debug_log(int level, const char *function, int line, const char *fmt, ...)
14
+ MDBX_PRINTF_ARGS(4, 5);
15
+ MDBX_INTERNAL void debug_log_va(int level, const char *function, int line, const char *fmt, va_list args);
16
+
17
+ #if MDBX_DEBUG
18
+ #define LOG_ENABLED(LVL) unlikely(LVL <= globals.loglevel)
19
+ #define AUDIT_ENABLED() unlikely((globals.runtime_flags & (unsigned)MDBX_DBG_AUDIT))
20
+ #else /* MDBX_DEBUG */
21
+ #define LOG_ENABLED(LVL) (LVL < MDBX_LOG_VERBOSE && LVL <= globals.loglevel)
22
+ #define AUDIT_ENABLED() (0)
23
+ #endif /* LOG_ENABLED() & AUDIT_ENABLED() */
24
+
25
+ #if MDBX_FORCE_ASSERTIONS
26
+ #define ASSERT_ENABLED() (1)
27
+ #elif MDBX_DEBUG
28
+ #define ASSERT_ENABLED() likely((globals.runtime_flags & (unsigned)MDBX_DBG_ASSERT))
29
+ #else
30
+ #define ASSERT_ENABLED() (0)
31
+ #endif /* ASSERT_ENABLED() */
32
+
33
+ #define DEBUG_EXTRA(fmt, ...) \
34
+ do { \
35
+ if (LOG_ENABLED(MDBX_LOG_EXTRA)) \
36
+ debug_log(MDBX_LOG_EXTRA, __func__, __LINE__, fmt, __VA_ARGS__); \
37
+ } while (0)
38
+
39
+ #define DEBUG_EXTRA_PRINT(fmt, ...) \
40
+ do { \
41
+ if (LOG_ENABLED(MDBX_LOG_EXTRA)) \
42
+ debug_log(MDBX_LOG_EXTRA, nullptr, 0, fmt, __VA_ARGS__); \
43
+ } while (0)
44
+
45
+ #define TRACE(fmt, ...) \
46
+ do { \
47
+ if (LOG_ENABLED(MDBX_LOG_TRACE)) \
48
+ debug_log(MDBX_LOG_TRACE, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
49
+ } while (0)
50
+
51
+ #define DEBUG(fmt, ...) \
52
+ do { \
53
+ if (LOG_ENABLED(MDBX_LOG_DEBUG)) \
54
+ debug_log(MDBX_LOG_DEBUG, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
55
+ } while (0)
56
+
57
+ #define VERBOSE(fmt, ...) \
58
+ do { \
59
+ if (LOG_ENABLED(MDBX_LOG_VERBOSE)) \
60
+ debug_log(MDBX_LOG_VERBOSE, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
61
+ } while (0)
62
+
63
+ #define NOTICE(fmt, ...) \
64
+ do { \
65
+ if (LOG_ENABLED(MDBX_LOG_NOTICE)) \
66
+ debug_log(MDBX_LOG_NOTICE, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
67
+ } while (0)
68
+
69
+ #define WARNING(fmt, ...) \
70
+ do { \
71
+ if (LOG_ENABLED(MDBX_LOG_WARN)) \
72
+ debug_log(MDBX_LOG_WARN, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
73
+ } while (0)
74
+
75
+ #undef ERROR /* wingdi.h \
76
+ Yeah, morons from M$ put such definition to the public header. */
77
+
78
+ #define ERROR(fmt, ...) \
79
+ do { \
80
+ if (LOG_ENABLED(MDBX_LOG_ERROR)) \
81
+ debug_log(MDBX_LOG_ERROR, __func__, __LINE__, fmt "\n", __VA_ARGS__); \
82
+ } while (0)
83
+
84
+ #define FATAL(fmt, ...) debug_log(MDBX_LOG_FATAL, __func__, __LINE__, fmt "\n", __VA_ARGS__);
85
+
86
+ #if MDBX_DEBUG
87
+ #define ASSERT_FAIL(env, msg, func, line) mdbx_assert_fail(env, msg, func, line)
88
+ #else /* MDBX_DEBUG */
89
+ MDBX_NORETURN __cold void assert_fail(const char *msg, const char *func, unsigned line);
90
+ #define ASSERT_FAIL(env, msg, func, line) \
91
+ do { \
92
+ (void)(env); \
93
+ assert_fail(msg, func, line); \
94
+ } while (0)
95
+ #endif /* MDBX_DEBUG */
96
+
97
+ #define ENSURE_MSG(env, expr, msg) \
98
+ do { \
99
+ if (unlikely(!(expr))) \
100
+ ASSERT_FAIL(env, msg, __func__, __LINE__); \
101
+ } while (0)
102
+
103
+ #define ENSURE(env, expr) ENSURE_MSG(env, expr, #expr)
104
+
105
+ /* assert(3) variant in environment context */
106
+ #define eASSERT(env, expr) \
107
+ do { \
108
+ if (ASSERT_ENABLED()) \
109
+ ENSURE(env, expr); \
110
+ } while (0)
111
+
112
+ /* assert(3) variant in cursor context */
113
+ #define cASSERT(mc, expr) eASSERT((mc)->txn->env, expr)
114
+
115
+ /* assert(3) variant in transaction context */
116
+ #define tASSERT(txn, expr) eASSERT((txn)->env, expr)
117
+
118
+ #ifndef xMDBX_TOOLS /* Avoid using internal eASSERT() */
119
+ #undef assert
120
+ #define assert(expr) eASSERT(nullptr, expr)
121
+ #endif
122
+
123
+ MDBX_MAYBE_UNUSED static inline void jitter4testing(bool tiny) {
124
+ #if MDBX_DEBUG
125
+ if (globals.runtime_flags & (unsigned)MDBX_DBG_JITTER)
126
+ osal_jitter(tiny);
127
+ #else
128
+ (void)tiny;
129
+ #endif
130
+ }
131
+
132
+ MDBX_MAYBE_UNUSED MDBX_INTERNAL void page_list(page_t *mp);
133
+
134
+ MDBX_INTERNAL const char *pagetype_caption(const uint8_t type, char buf4unknown[16]);
135
+ /* Key size which fits in a DKBUF (debug key buffer). */
136
+ #define DKBUF_MAX 127
137
+ #define DKBUF char dbg_kbuf[DKBUF_MAX * 4 + 2]
138
+ #define DKEY(x) mdbx_dump_val(x, dbg_kbuf, DKBUF_MAX * 2 + 1)
139
+ #define DVAL(x) mdbx_dump_val(x, dbg_kbuf + DKBUF_MAX * 2 + 1, DKBUF_MAX * 2 + 1)
140
+
141
+ #if MDBX_DEBUG
142
+ #define DKBUF_DEBUG DKBUF
143
+ #define DKEY_DEBUG(x) DKEY(x)
144
+ #define DVAL_DEBUG(x) DVAL(x)
145
+ #else
146
+ #define DKBUF_DEBUG ((void)(0))
147
+ #define DKEY_DEBUG(x) ("-")
148
+ #define DVAL_DEBUG(x) ("-")
149
+ #endif
150
+
151
+ MDBX_INTERNAL void log_error(const int err, const char *func, unsigned line);
152
+
153
+ MDBX_MAYBE_UNUSED static inline int log_if_error(const int err, const char *func, unsigned line) {
154
+ if (unlikely(err != MDBX_SUCCESS))
155
+ log_error(err, func, line);
156
+ return err;
157
+ }
158
+
159
+ #define LOG_IFERR(err) log_if_error((err), __func__, __LINE__)
@@ -0,0 +1,106 @@
1
+ .\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
3
+ .TH MDBX_CHK 1 "2024-08-29" "MDBX 0.13"
4
+ .SH NAME
5
+ mdbx_chk \- MDBX checking tool
6
+ .SH SYNOPSIS
7
+ .B mdbx_chk
8
+ [\c
9
+ .BR \-V ]
10
+ [\c
11
+ .BR \-v [ v [ v ]]]
12
+ [\c
13
+ .BR \-n ]
14
+ [\c
15
+ .BR \-q ]
16
+ [\c
17
+ .BR \-c ]
18
+ [\c
19
+ .BR \-w ]
20
+ [\c
21
+ .BR \-d ]
22
+ [\c
23
+ .BR \-i ]
24
+ [\c
25
+ .BI \-s \ table\fR]
26
+ .BR \ dbpath
27
+ .SH DESCRIPTION
28
+ The
29
+ .B mdbx_chk
30
+ utility is intended to check an MDBX database file.
31
+ .SH OPTIONS
32
+ .TP
33
+ .BR \-V
34
+ Write the library version number to the standard output, and exit.
35
+ .TP
36
+ .BR \-v
37
+ Produce verbose output, including summarize space and page usage statistics.
38
+ If \fB\-vv\fP is given, be more verbose, show summarized B-tree info
39
+ and space allocation.
40
+ If \fB\-vvv\fP is given, be more verbose, include summarized statistics
41
+ of leaf B-tree pages.
42
+ If \fB\-vvvv\fP is given, be even more verbose, show info of each page
43
+ during B-tree traversal and basic info of each GC record.
44
+ If \fB\-vvvvv\fP is given, turn maximal verbosity, display the full list
45
+ of page IDs in the GC records and size of each key-value pair of database(s).
46
+ .TP
47
+ .BR \-q
48
+ Be quiet; do not output anything even if an error was detected.
49
+ .TP
50
+ .BR \-c
51
+ Force using cooperative mode while opening environment, i.e. don't try to open
52
+ in exclusive/monopolistic mode. Only exclusive/monopolistic mode allow complete
53
+ check, including full check of all meta-pages and actual size of database file.
54
+ .TP
55
+ .BR \-w
56
+ Open environment in read-write mode and lock for writing while checking.
57
+ This could be impossible if environment already used by another process(s)
58
+ in an incompatible read-write mode. This allows rollback to last steady commit
59
+ (in case environment was not closed properly) and then check transaction IDs
60
+ of meta-pages. Otherwise, without \fB\-w\fP option environment will be
61
+ opened in read-only mode.
62
+ .TP
63
+ .BR \-d
64
+ Disable page-by-page traversal of B-tree. In this case, without B-tree
65
+ traversal, it is unable to check for lost-unused pages nor for double-used
66
+ pages.
67
+ .TP
68
+ .BR \-i
69
+ Ignore wrong order errors, which will likely false-positive if custom
70
+ comparator(s) was used.
71
+ .TP
72
+ .BR \-s \ table
73
+ Verify and show info only for a specific table.
74
+ .TP
75
+ .BR \-0 | \-1 | \-2
76
+ Using specific meta-page 0, or 2 for checking.
77
+ .TP
78
+ .BR \-t
79
+ Turn to a specified meta-page on successful check.
80
+ .TP
81
+ .BR \-T
82
+ Turn to a specified meta-page EVEN ON UNSUCCESSFUL CHECK!
83
+ .TP
84
+ .BR \-u
85
+ Warms up the DB before checking via notifying OS kernel of subsequent access to the database pages.
86
+ .TP
87
+ .BR \-U
88
+ Warms up the DB before checking, notifying the OS kernel of subsequent access to the database pages,
89
+ then forcibly loads ones by sequential access and tries to lock database pages in memory.
90
+ .TP
91
+ .BR \-n
92
+ Open MDBX environment(s) which do not use subdirectories.
93
+ This is a legacy option. For now MDBX handles this automatically.
94
+
95
+ .SH DIAGNOSTICS
96
+ Exit status is zero if no errors occur. Errors result in a non-zero exit status
97
+ and a diagnostic message being written to standard error
98
+ if no quiet mode was requested.
99
+ .SH "SEE ALSO"
100
+ .BR mdbx_stat (1),
101
+ .BR mdbx_copy (1),
102
+ .BR mdbx_dump (1),
103
+ .BR mdbx_load (1)
104
+ .BR mdbx_drop (1)
105
+ .SH AUTHOR
106
+ Leonid Yuriev <https://gitflic.ru/user/erthink>
@@ -0,0 +1,95 @@
1
+ .\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
3
+ .\" Copyright 2012-2015 Howard Chu, Symas Corp. All Rights Reserved.
4
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5
+ .TH MDBX_COPY 1 "2024-08-29" "MDBX 0.13"
6
+ .SH NAME
7
+ mdbx_copy \- MDBX environment copy tool
8
+ .SH SYNOPSIS
9
+ .B mdbx_copy
10
+ [\c
11
+ .BR \-V ]
12
+ [\c
13
+ .BR \-q ]
14
+ [\c
15
+ .BR \-c ]
16
+ [\c
17
+ .BR \-d ]
18
+ [\c
19
+ .BR \-p ]
20
+ [\c
21
+ .BR \-n ]
22
+ .B src_path
23
+ [\c
24
+ .BR dest_path ]
25
+ .SH DESCRIPTION
26
+ The
27
+ .B mdbx_copy
28
+ utility copies an MDBX environment. The environment can
29
+ be copied regardless of whether it is currently in use.
30
+ No lockfile is created, since it gets recreated at need.
31
+
32
+ If
33
+ .I dest_path
34
+ is specified it must be the path of an empty directory
35
+ for storing the backup. Otherwise, the backup will be
36
+ written to stdout.
37
+
38
+ .SH OPTIONS
39
+ .TP
40
+ .BR \-V
41
+ Write the library version number to the standard output, and exit.
42
+ .TP
43
+ .BR \-q
44
+ Be quiet.
45
+ .TP
46
+ .BR \-c
47
+ Compact while copying. Only current data pages will be copied; freed
48
+ or unused pages will be omitted from the copy. This option will
49
+ slow down the backup process as it is more CPU-intensive.
50
+ Currently it fails if the environment has suffered a page leak.
51
+ .TP
52
+ .BR \-d
53
+ Alters geometry to enforce the copy to be a dynamic size DB,
54
+ which could be growth and shrink by reasonable steps on the fly.
55
+ .TP
56
+ .BR \-p
57
+ Use read transaction parking/ousting during copying MVCC-snapshot.
58
+ This allows the writing transaction to oust the read
59
+ transaction used to copy the database if copying takes so long
60
+ that it will interfere with the recycling old MVCC snapshots
61
+ and may lead to an overflow of the database.
62
+ However, if the reading transaction is ousted the copy will
63
+ be aborted until successful completion. Thus, this option
64
+ allows copy the database without interfering with write
65
+ transactions and a threat of database overflow, but at the cost
66
+ that copying will be aborted to prevent such conditions.
67
+ .TP
68
+ .BR \-u
69
+ Warms up the DB before copying via notifying OS kernel of subsequent access to the database pages.
70
+ .TP
71
+ .BR \-U
72
+ Warms up the DB before copying, notifying the OS kernel of subsequent access to the database pages,
73
+ then forcibly loads ones by sequential access and tries to lock database pages in memory.
74
+ .TP
75
+ .BR \-n
76
+ Open MDBX environment(s) which do not use subdirectories.
77
+ This is legacy option. For now MDBX handles this automatically.
78
+
79
+ .SH DIAGNOSTICS
80
+ Exit status is zero if no errors occur.
81
+ Errors result in a non-zero exit status and
82
+ a diagnostic message being written to standard error.
83
+ .SH CAVEATS
84
+ This utility can trigger significant file size growth if run
85
+ in parallel with write transactions, because pages which they
86
+ free during copying cannot be reused until the copy is done.
87
+ .SH "SEE ALSO"
88
+ .BR mdbx_dump (1),
89
+ .BR mdbx_chk (1),
90
+ .BR mdbx_stat (1),
91
+ .BR mdbx_load (1)
92
+ .BR mdbx_drop (1)
93
+ .SH AUTHOR
94
+ Howard Chu of Symas Corporation <http://www.symas.com>,
95
+ Leonid Yuriev <https://gitflic.ru/user/erthink>
@@ -0,0 +1,48 @@
1
+ .\" Copyright 2021-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copyright 2014-2021 Howard Chu, Symas Corp. All Rights Reserved.
3
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
4
+ .TH MDBX_DROP 1 "2024-08-29" "MDBX 0.13"
5
+ .SH NAME
6
+ mdbx_drop \- MDBX database delete tool
7
+ .SH SYNOPSIS
8
+ .B mdbx_drop
9
+ [\c
10
+ .BR \-V ]
11
+ [\c
12
+ .BR \-d ]
13
+ [\c
14
+ .BI \-s \ table\fR]
15
+ [\c
16
+ .BR \-n ]
17
+ .BR \ dbpath
18
+ .SH DESCRIPTION
19
+ The
20
+ .B mdbx_drop
21
+ utility empties or deletes a database in the specified
22
+ environment.
23
+ .SH OPTIONS
24
+ .TP
25
+ .BR \-V
26
+ Write the library version number to the standard output, and exit.
27
+ .TP
28
+ .BR \-d
29
+ Delete the specified database, don't just empty it.
30
+ .TP
31
+ .BR \-s \ table
32
+ Operate on a specific table. If no table is specified, only the main table is dropped.
33
+ .TP
34
+ .BR \-n
35
+ Dump an MDBX database which does not use subdirectories.
36
+ This is legacy option. For now MDBX handles this automatically.
37
+
38
+ .SH DIAGNOSTICS
39
+ Exit status is zero if no errors occur.
40
+ Errors result in a non-zero exit status and
41
+ a diagnostic message being written to standard error.
42
+ .SH "SEE ALSO"
43
+ .BR mdbx_load (1),
44
+ .BR mdbx_copy (1),
45
+ .BR mdbx_chk (1),
46
+ .BR mdbx_stat (1)
47
+ .SH AUTHOR
48
+ Howard Chu of Symas Corporation <http://www.symas.com>
@@ -0,0 +1,101 @@
1
+ .\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
3
+ .\" Copyright 2014-2015 Howard Chu, Symas Corp. All Rights Reserved.
4
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5
+ .TH MDBX_DUMP 1 "2024-08-29" "MDBX 0.13"
6
+ .SH NAME
7
+ mdbx_dump \- MDBX environment export tool
8
+ .SH SYNOPSIS
9
+ .B mdbx_dump
10
+ [\c
11
+ .BR \-V ]
12
+ [\c
13
+ .BR \-q ]
14
+ [\c
15
+ .BI \-f \ file\fR]
16
+ [\c
17
+ .BR \-l ]
18
+ [\c
19
+ .BR \-p ]
20
+ [\c
21
+ .BR \-a \ |
22
+ .BI \-s \ table\fR]
23
+ [\c
24
+ .BR \-r ]
25
+ [\c
26
+ .BR \-n ]
27
+ .BR \ dbpath
28
+ .SH DESCRIPTION
29
+ The
30
+ .B mdbx_dump
31
+ utility reads a database and writes its contents to the
32
+ standard output using a portable flat-text format
33
+ understood by the
34
+ .BR mdbx_load (1)
35
+ utility.
36
+ .SH OPTIONS
37
+ .TP
38
+ .BR \-V
39
+ Write the library version number to the standard output, and exit.
40
+ .TP
41
+ .BR \-q
42
+ Be quiet.
43
+ .TP
44
+ .BR \-f \ file
45
+ Write to the specified file instead of to the standard output.
46
+ .TP
47
+ .BR \-l
48
+ List the databases stored in the environment. Just the
49
+ names will be listed, no data will be output.
50
+ .TP
51
+ .BR \-p
52
+ If characters in either the key or data items are printing characters (as
53
+ defined by isprint(3)), output them directly. This option permits users to
54
+ use standard text editors and tools to modify the contents of databases.
55
+
56
+ Note: different systems may have different notions about what characters
57
+ are considered printing characters, and databases dumped in this manner may
58
+ be less portable to external systems.
59
+ .TP
60
+ .BR \-a
61
+ Dump all of the tables in the environment.
62
+ .TP
63
+ .BR \-s \ table
64
+ Dump a specific table. If no database is specified, only the main table is dumped.
65
+ .TP
66
+ .BR \-r
67
+ Rescure mode. Ignore some errors to dump corrupted DB.
68
+ .TP
69
+ .BR \-u
70
+ Warms up the DB before dumping via notifying OS kernel of subsequent access to the database pages.
71
+ .TP
72
+ .BR \-U
73
+ Warms up the DB before dumping, notifying the OS kernel of subsequent access to the database pages,
74
+ then forcibly loads ones by sequential access and tries to lock database pages in memory.
75
+ .TP
76
+ .BR \-n
77
+ Dump an MDBX database which does not use subdirectories.
78
+ This is legacy option. For now MDBX handles this automatically.
79
+
80
+ .SH DIAGNOSTICS
81
+ Exit status is zero if no errors occur.
82
+ Errors result in a non-zero exit status and
83
+ a diagnostic message being written to standard error.
84
+
85
+ Dumping and reloading databases that use user-defined comparison functions
86
+ will result in new databases that use the default comparison functions.
87
+ \fBIn this case it is quite likely that the reloaded database will be
88
+ damaged beyond repair permitting neither record storage nor retrieval.\fP
89
+
90
+ The only available workaround is to modify the source for the
91
+ .BR mdbx_load (1)
92
+ utility to load the database using the correct comparison functions.
93
+ .SH "SEE ALSO"
94
+ .BR mdbx_load (1),
95
+ .BR mdbx_copy (1),
96
+ .BR mdbx_chk (1),
97
+ .BR mdbx_stat (1)
98
+ .BR mdbx_drop (1)
99
+ .SH AUTHOR
100
+ Howard Chu of Symas Corporation <http://www.symas.com>,
101
+ Leonid Yuriev <https://gitflic.ru/user/erthink>
@@ -0,0 +1,105 @@
1
+ .\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
3
+ .\" Copyright 2014-2015 Howard Chu, Symas Corp. All Rights Reserved.
4
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5
+ .TH MDBX_LOAD 1 "2024-08-29" "MDBX 0.13"
6
+ .SH NAME
7
+ mdbx_load \- MDBX environment import tool
8
+ .SH SYNOPSIS
9
+ .B mdbx_load
10
+ [\c
11
+ .BR \-V ]
12
+ [\c
13
+ .BR \-q ]
14
+ [\c
15
+ .BR \-a ]
16
+ [\c
17
+ .BI \-f \ file\fR]
18
+ [\c
19
+ .BI \-s \ table\fR]
20
+ [\c
21
+ .BR \-N ]
22
+ [\c
23
+ .BR \-T ]
24
+ [\c
25
+ .BR \-r ]
26
+ [\c
27
+ .BR \-n ]
28
+ .BR \ dbpath
29
+ .SH DESCRIPTION
30
+ The
31
+ .B mdbx_load
32
+ utility reads from the standard input and loads it into the
33
+ MDBX environment
34
+ .BR dbpath .
35
+
36
+ The input to
37
+ .B mdbx_load
38
+ must be in the output format specified by the
39
+ .BR mdbx_dump (1)
40
+ utility or as specified by the
41
+ .B -T
42
+ option below.
43
+
44
+ A simple escape mechanism, where newline and backslash (\\) characters are special, is
45
+ applied to the text input. Newline characters are interpreted as record separators.
46
+ Backslash characters in the text will be interpreted in one of two ways: If the backslash
47
+ character precedes another backslash character, the pair will be interpreted as a literal
48
+ backslash. If the backslash character precedes any other character, the two characters
49
+ following the backslash will be interpreted as a hexadecimal specification of a single
50
+ character; for example, \\0a is a newline character in the ASCII character set.
51
+
52
+ For this reason, any backslash or newline characters that naturally occur in the text
53
+ input must be escaped to avoid misinterpretation by
54
+ .BR mdbx_load .
55
+
56
+ .SH OPTIONS
57
+ .TP
58
+ .BR \-V
59
+ Write the library version number to the standard output, and exit.
60
+ .TP
61
+ .BR \-q
62
+ Be quiet.
63
+ .TP
64
+ .BR \-a
65
+ Append all records in the order they appear in the input. The input is assumed to already be
66
+ in correctly sorted order and no sorting or checking for redundant values will be performed.
67
+ This option must be used to reload data that was produced by running
68
+ .B mdbx_dump
69
+ on a database that uses custom compare functions.
70
+ .TP
71
+ .BR \-f \ file
72
+ Read from the specified file instead of from the standard input.
73
+ .TP
74
+ .BR \-s \ table
75
+ Load a specific table. If no table is specified, data is loaded into the main table.
76
+ .TP
77
+ .BR \-N
78
+ Don't overwrite existing records when loading into an already existing table; just skip them.
79
+ .TP
80
+ .BR \-T
81
+ Load data from simple text files. The input must be paired lines of text, where the first
82
+ line of the pair is the key item, and the second line of the pair is its corresponding
83
+ data item.
84
+ .TP
85
+ .BR \-r
86
+ Rescure mode. Ignore errors to load corrupted DB dump.
87
+ .TP
88
+ .BR \-n
89
+ Load an MDBX database which does not use subdirectories.
90
+ This is legacy option. For now MDBX handles this automatically.
91
+
92
+ .SH DIAGNOSTICS
93
+ Exit status is zero if no errors occur.
94
+ Errors result in a non-zero exit status and
95
+ a diagnostic message being written to standard error.
96
+
97
+ .SH "SEE ALSO"
98
+ .BR mdbx_dump (1),
99
+ .BR mdbx_chk (1),
100
+ .BR mdbx_stat (1),
101
+ .BR mdbx_copy (1)
102
+ .BR mdbx_drop (1)
103
+ .SH AUTHOR
104
+ Howard Chu of Symas Corporation <http://www.symas.com>,
105
+ Leonid Yuriev <https://gitflic.ru/user/erthink>
@@ -0,0 +1,86 @@
1
+ .\" Copyright 2015-2025 Leonid Yuriev <leo@yuriev.ru>.
2
+ .\" Copyright 2015,2016 Peter-Service R&D LLC <http://billing.ru/>.
3
+ .\" Copyright 2012-2015 Howard Chu, Symas Corp. All Rights Reserved.
4
+ .\" Copying restrictions apply. See COPYRIGHT/LICENSE.
5
+ .TH MDBX_STAT 1 "2024-08-29" "MDBX 0.13"
6
+ .SH NAME
7
+ mdbx_stat \- MDBX environment status tool
8
+ .SH SYNOPSIS
9
+ .B mdbx_stat
10
+ [\c
11
+ .BR \-V ]
12
+ [\c
13
+ .BR \-q ]
14
+ [\c
15
+ .BR \-p ]
16
+ [\c
17
+ .BR \-e ]
18
+ [\c
19
+ .BR \-f [ f [ f ]]]
20
+ [\c
21
+ .BR \-r [ r ]]
22
+ [\c
23
+ .BR \-a \ |
24
+ .BI \-s \ table\fR]
25
+ .BR \ dbpath
26
+ [\c
27
+ .BR \-n ]
28
+ .SH DESCRIPTION
29
+ The
30
+ .B mdbx_stat
31
+ utility displays the status of an MDBX environment.
32
+ .SH OPTIONS
33
+ .TP
34
+ .BR \-V
35
+ Write the library version number to the standard output, and exit.
36
+ .TP
37
+ .BR \-q
38
+ Be quiet.
39
+ .TP
40
+ .BR \-p
41
+ Display overall statistics of page operations of all (running, completed
42
+ and aborted) transactions in the current multi-process session (since the
43
+ first process opened the database after everyone had previously closed it).
44
+ .TP
45
+ .BR \-e
46
+ Display information about the database environment.
47
+ .TP
48
+ .BR \-f
49
+ Display information about the environment GC.
50
+ If \fB\-ff\fP is given, summarize each GC/freelist entry.
51
+ If \fB\-fff\fP is given, display the full list of page IDs in the GC/freelist.
52
+ .TP
53
+ .BR \-r
54
+ Display information about the environment reader table.
55
+ Shows the process ID, thread ID, and transaction ID for each active
56
+ reader slot. The process ID and transaction ID are in decimal, the
57
+ thread ID is in hexadecimal. The transaction ID is displayed as "-"
58
+ if the reader does not currently have a read transaction open.
59
+ If \fB\-rr\fP is given, check for stale entries in the reader
60
+ table and clear them. The reader table will be printed again
61
+ after the check is performed.
62
+ .TP
63
+ .BR \-a
64
+ Display the status of all of the tables in the environment.
65
+ .TP
66
+ .BR \-s \ table
67
+ Display the status of a specific table.
68
+ .TP
69
+ .BR \-n
70
+ Display the status of an MDBX database which does not use subdirectories.
71
+ This is legacy option. For now MDBX handles this automatically
72
+ for existing databases, but may be required while creating new.
73
+
74
+ .SH DIAGNOSTICS
75
+ Exit status is zero if no errors occur.
76
+ Errors result in a non-zero exit status and
77
+ a diagnostic message being written to standard error.
78
+ .SH "SEE ALSO"
79
+ .BR mdbx_chk (1),
80
+ .BR mdbx_copy (1),
81
+ .BR mdbx_dump (1),
82
+ .BR mdbx_load (1)
83
+ .BR mdbx_drop (1)
84
+ .SH AUTHOR
85
+ Howard Chu of Symas Corporation <http://www.symas.com>,
86
+ Leonid Yuriev <https://gitflic.ru/user/erthink>