Skip to content

Populate index with keydef #7356

@Mons

Description

@Mons

PM link

The problem

Currently, extracting key part from a tuple is not so simple.
Also, there is a handy keydef module.

Currently user have to create keydef for the index

local keydef = require('tuple.keydef')
local ix = box.space[ ... ].index[ ... ]
local kd = pcall(keydef.new, ix.parts)

And then use keydef to extract key from tuple

local key = kd:extract_key( tuple )

(And also keydef is not working with rtree)

The proposition

I propose to extend index object with it's keydef and then use it like

local key = box.space[ ... ].index[ ... ].keydef:extract_key( tuple )

Metadata

Metadata

Assignees

Labels

3.0Target is 3.0 and all newer release/master branchesfeatureA new functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions