Skip to content

index_object.parts methods #3444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TarantoolBot opened this issue Apr 18, 2023 · 0 comments · Fixed by #5126
Closed

index_object.parts methods #3444

TarantoolBot opened this issue Apr 18, 2023 · 0 comments · Fixed by #5126
Assignees
Labels
3.0 reference [location] Tarantool manual, Reference part

Comments

@TarantoolBot
Copy link
Collaborator

TarantoolBot commented Apr 18, 2023

Related dev issue: tarantool/tarantool#7356

Product: Tarantool
Since: 3.0
Root document:

SME: @ Gumix

Details

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.

index_object.parts can be used like a key_def module instance for calling
the corresponding methods. Example:

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:

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}))

Requested by @ Gumix in tarantool/tarantool@55295f5.

@Gumix Gumix added the 3.0 label Dec 18, 2023
@andreyaksenov andreyaksenov added the reference [location] Tarantool manual, Reference part label Jul 16, 2024
AArdeev added a commit that referenced this issue May 22, 2025
Since version 3.0.0 the ```box_index:parts``` can use methods of ```key_def```
Fixes #3444
AArdeev added a commit that referenced this issue May 23, 2025
* Updates description of ```box_index.parts``` with new methods
* Since version 3.0.0 the ```box_index.parts``` can use methods of ```key_def```

Fixes #3444
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 reference [location] Tarantool manual, Reference part
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants