[tarantool-patches] Re: [PATCH v1 1/1] lua: export key_def methods for LUA key_def object

Konstantin Osipov kostja at tarantool.org
Tue Apr 23 18:05:30 MSK 2019


* Kirill Shcherbatov <kshcherbatov at tarantool.org> [19/03/25 15:29]:
> Functions extract_key, compare, compare_with_key, merge defined
> for key_def introduced for LUA key_def object.
> 
> Close #4025
> 
> @TarantoolBot document
> Title: Built-in methods for key_def object
> Now it is possible to work with index base object - key
> definition in LUA. Available methods:
> key = key_def:extract_key(tuple)
> key_def:compare(tuple_a, tuple_b)
> key_def:compare_with_key(tuple, key), where key is tuple or table
> new_key_def = key_def:merge(second_key_def)

The API mostly looks good to me. I hesitated a bit about
extract_key() building a tuple, not returning a raw msgpack
pointer and part count, like C api, but then I erred on the side
of safety.

-- 
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov




More information about the Tarantool-patches mailing list