mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-02 00:34:13 +08:00
mdbx-doc: more for custom comparators.
Change-Id: I3326c5bdedbbdb01b1865bff68aa7ba8bc7056cc
This commit is contained in:
parent
8358dda7f1
commit
251d34d6e6
11
mdbx.h
11
mdbx.h
@ -2590,9 +2590,14 @@ typedef int(MDBX_cmp_func)(const MDBX_val *a, const MDBX_val *b);
|
||||
* comparison functions for keys and values (for multimaps).
|
||||
* However, I recommend not using custom comparison functions, but instead
|
||||
* converting the keys to one of the forms that are suitable for built-in
|
||||
* comparators. The main reason for this is that you can't use mdbx_chk tools
|
||||
* with a custom comparators. For instance take look to the mdbx_key_from_xxx()
|
||||
* functions.
|
||||
* comparators (for instance take look to the mdbx_key_from_xxx()
|
||||
* functions). The reasons to not using custom comparators are:
|
||||
* - The order of records could not be validated without your code.
|
||||
* So mdbx_chk utility will reports "wrong order" errors
|
||||
* and the '-i' option is required to ignore ones.
|
||||
* - A records could not be ordered or sorted without your code.
|
||||
* So mdbx_load utility should be used with '-a' option to preserve
|
||||
* input data order.
|
||||
*
|
||||
* [in] keycmp Optional custom key comparison function for a database.
|
||||
* [in] datacmp Optional custom data comparison function for a database, takes
|
||||
|
@ -339,7 +339,8 @@ static void usage(void) {
|
||||
"dbpath\n"
|
||||
" -V\t\tprint version and exit\n"
|
||||
" -q\t\tbe quiet\n"
|
||||
" -a\t\tappend records in input order\n"
|
||||
" -a\t\tappend records in input order (required for custom "
|
||||
"comparators)\n"
|
||||
" -f file\tread from file instead of stdin\n"
|
||||
" -s name\tload into named subDB\n"
|
||||
" -N\t\tuse NOOVERWRITE on puts\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user