-
Notifications
You must be signed in to change notification settings - Fork 2
/
mdbx.1
226 lines (214 loc) · 3.25 KB
/
mdbx.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "MDBX" "1" "July 2017" "" ""
.
.SH "NAME"
\fBmdbx\fR \- LMDB Explorer
.
.SH "SYNOPSIS"
\fBmdbx\fR ACTION [OPTION [ARG] [OPTION [ARG] \.\.\.]] \fIlmdb env path\fR
.
.br
ACTIONS p|print a|printall w|write d|delete h|help
.
.br
\fB\-d\fR|\fB\-\-db\-name\fR \fIname\fR
.
.br
\fB\-k\fR|\fB\-\-key\fR \fIkey\fR \-\- string key, required for print
.
.br
\fB\-N\fR|\fB\-\-num\-data\fR \-\- print/input data as number
.
.br
\fB\-n\fR|\fB\-\-num\-key\fR \-\- input key as number
.
.br
\fB\-X\fR|\fB\-\-hex\-data\fR \-\- print/input data as number
.
.br
\fB\-x\fR|\fB\-\-hex\-key\fR \-\- input key as number)
.
.br
.
.SH "DESCRIPTION"
Command\-line tool for inspecting and editing the contents of (LMDB)[http://www\.lmdb\.tech/doc/] databases\.
.
.P
The default mode of operation is to interpret keys and values as ASCII strings\. Using the \-N, \-n, \-x, and \-X flags, they can be coded as 32\-bit integers or hex values\.
.
.SH "COMPILING"
Requires \fBpkg\-config\fR, \fBgetopt\fR, and \fBliblmdb\fR\. Run \fBmake\fR to compile\.
.
.P
To install, run \fBmake install\fR\. Requires \fBruby\-ronn\fR to build the man page\.
.
.SH "TESTS"
Requires \fBcheck\fR\. Run \fBmake test\fR to compile\. \fB\./test\fR to run tests\.
.
.SH "EXAMPLES"
.
.SS "Inspecting data"
List all databases:
.
.IP "" 4
.
.nf
\&\./mdbx p DB_DIR
.
.fi
.
.IP "" 0
.
.P
Print a value decoded as a string:
.
.IP "" 4
.
.nf
\&\./mdbx p \-k foo DB_DIR
.
.fi
.
.IP "" 0
.
.P
Print a value decoded as a 32\-bit integer:
.
.IP "" 4
.
.nf
\&\./mdbx p \-N \-k foo DB_DIR
.
.fi
.
.IP "" 0
.
.P
Print a value using a 32\-bit integer key:
.
.IP "" 4
.
.nf
\&\./mdbx p \-nk 123 DB_DIR
.
.fi
.
.IP "" 0
.
.P
Print a value decoded as hex:
.
.IP "" 4
.
.nf
\&\./mdbx p \-X \-k foo DB_DIR
.
.fi
.
.IP "" 0
.
.P
Print a value using a key encoded as hex:
.
.IP "" 4
.
.nf
\&\./mdbx p \-X \-k a0f0a1 DB_DIR
.
.fi
.
.IP "" 0
.
.SS "Editing data"
Write a value (this creates a new database if there isn\'t one at the location already):
.
.IP "" 4
.
.nf
\&\./mdbx w \-k foo \-v bar DB_DIR
.
.fi
.
.IP "" 0
.
.P
Write a value to a named database (this creates the :
.
.IP "" 4
.
.nf
\&\./mdbx w \-d somename \-k foo \-v bar DB_DIR
.
.fi
.
.IP "" 0
.
.P
Write a value with a binary key encoded as hex:
.
.IP "" 4
.
.nf
\&\./mdbx w \-xk a0f0a1 \-v bar DB_DIR
.
.fi
.
.IP "" 0
.
.P
Write a value with a binary value encoded as hex:
.
.IP "" 4
.
.nf
\&\./mdbx w \-xk a0f0a1 \-Xv 0a120b DB_DIR
.
.fi
.
.IP "" 0
.
.P
Write a value with a 32\-bit integer key:
.
.IP "" 4
.
.nf
\&\./mdbx w \-nk 123 \-v bar DB_DIR
.
.fi
.
.IP "" 0
.
.P
Write a 32\-bit integer value:
.
.IP "" 4
.
.nf
\&\./mdbx w \-k foo \-Nv bar DB_DIR
.
.fi
.
.IP "" 0
.
.SH "CONTRIBUTING"
Reporting Issues: Please create a GitHub Issue with details as to how to reproduce your issue\.
.
.P
Submitting Code: Please create a GitHub pull request\.
.
.P
Please install the pre\-commit hook, which does the following:
.
.IP "1." 4
Runs all code through astyle \-\-style=linux\. Please conform to the LMDB project style for anything not covered by Astyle\.
.
.IP "2." 4
Generates and commit the man page (mdbx\.1) using the ruby\-ronn tool
.
.IP "" 0
.
.P
All code submissions require a corresponding test, and must pass all existing tests\.