lua/key_def: add key validation and comparison functions
Closes #9863 @TarantoolBot document Title: Document key validation and comparison `key_def` module functions The following new functions were introduced to the `key_def` Lua module: - `key_def:validate_key(key)`: validates a key against a key definition object. Raises an exception if the key doesn't match. Returns nothing on success. See also `box_key_def_validate_key` C API function. - `key_def:validate_full_key(key)`: validates a full key against a key definition object. Raises an exception if the key doesn't match. Returns nothing on success. See also `box_key_def_validate_full_key` C API function. - `key_def:validate_tuple(tuple)`: validates a tuple against a key definition object. Raises an exception if the tuple doesn't match. Returns nothing on success. See also `box_key_def_validate_tuple` C API function. - `key_def:compare_keys(key_a, key_b)`: compares two keys according to a key definition object. Raises an exception if any of the given key doesn't match the key definition. On success, returns a value <0 if `key_a` parts are less than `key_b` parts, 0 if equal, >0 if greater.
Showing
- changelogs/unreleased/gh-9863-new-key-def-functions.md 4 additions, 0 deletionschangelogs/unreleased/gh-9863-new-key-def-functions.md
- src/box/lua/key_def.c 138 additions, 0 deletionssrc/box/lua/key_def.c
- src/box/lua/key_def.h 30 additions, 0 deletionssrc/box/lua/key_def.h
- src/box/lua/key_def.lua 4 additions, 0 deletionssrc/box/lua/key_def.lua
- src/box/lua/space.cc 78 additions, 4 deletionssrc/box/lua/space.cc
- test/app-luatest/key_def_test.lua 231 additions, 0 deletionstest/app-luatest/key_def_test.lua
- test/box-luatest/gh_7356_index_parts_methods_test.lua 234 additions, 0 deletionstest/box-luatest/gh_7356_index_parts_methods_test.lua
Loading
Please register or sign in to comment