Skip to content

Document key validation and comparison key_def module functions #4111

Closed
@TarantoolBot

Description

@TarantoolBot

Related dev. issue(s): tarantool/tarantool#9863

Product: Tarantool
Since: 3.1
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/key_def/
SME: @ locker

Details

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.
    Requested by @ locker in tarantool/tarantool@7e5881e.

Metadata

Metadata

Assignees

Labels

3.1reference[location] Tarantool manual, Reference part

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions