key_def: Introduce `__len` metamethod
The metamethod is a way to key_def length introspection. Closes #10111 @TarantoolBot document Title: key_def length introspection To check key_def length (parts count) there is a standard lua operator `#` (`__len` metamethod). Example: ```lua function is_full_pkey(space, key) return #space.index[0].parts == #key end ```
Showing
- changelogs/unreleased/gh-10111-provide-key_def-length.md 3 additions, 0 deletionschangelogs/unreleased/gh-10111-provide-key_def-length.md
- src/box/lua/key_def.c 14 additions, 0 deletionssrc/box/lua/key_def.c
- src/box/lua/key_def.lua 1 addition, 0 deletionssrc/box/lua/key_def.lua
- test/box-tap/key_def.test.lua 17 additions, 1 deletiontest/box-tap/key_def.test.lua
Loading
Please register or sign in to comment