lua/key_def: add key validation and comparison functions#9868
Merged
locker merged 1 commit intotarantool:masterfrom Mar 27, 2024
Merged
lua/key_def: add key validation and comparison functions#9868locker merged 1 commit intotarantool:masterfrom
locker merged 1 commit intotarantool:masterfrom
Conversation
xuniq
approved these changes
Mar 26, 2024
Totktonada
approved these changes
Mar 26, 2024
Closes tarantool#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.
070590c to
1b2517c
Compare
ylobankov
approved these changes
Mar 27, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following new functions were introduced to the
key_defLua 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 alsobox_key_def_validate_keyC 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 alsobox_key_def_validate_full_keyC 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 alsobox_key_def_validate_tupleC 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 ifkey_aparts are less thankey_bparts, 0 if equal, >1 if greater.Closes #9863