Ilya Verbin
authored
This patch adds 4 methods of the key_def module instance to the `index_object.parts`, see the docbot request for details. The rest methods (new() and totable()) are not applicable here, because the instance is already created and pushed to the stack as a table. Closes #7356 @TarantoolBot document Title: `index_object.parts` methods Product: Tarantool Since: 3.0 Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_index/parts/ `index_object.parts` has the following methods: `extract_key()`, `compare()`, `compare_with_key()`, `merge()`. For their description and usage examples, refer to [Module key_def](https://www.tarantool.io/en/doc/latest/reference/reference_lua/key_def/#lua-object.key_def.key_def_object). --- Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/key_def/ `index_object.parts` can be used like a key_def module instance for calling the corresponding methods. Example: ```lua box.schema.space.create('T') i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}}) box.space.T:insert{1, 99.5, 'X', nil, 99.5} i.parts:extract_key(box.space.T:get({'X', 1})) ``` The code above is equivalent to: ```lua key_def = require('key_def') box.schema.space.create('T') i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}}) box.space.T:insert{1, 99.5, 'X', nil, 99.5} k = key_def.new(i.parts) k:extract_key(box.space.T:get({'X', 1})) ```
Name | Last commit | Last update |
---|