crud
crud copied to clipboard
Merge "key_def" and "comparators" into single cross-version comparator module
I sure that it should be encapsulated in compare.keydef.I mean, using comparators instead of keydef.
Originally posted by @dokshina in https://github.com/tarantool/crud/pull/167#discussion_r645319148
Maybe as part of the tuple-keydef module itself?
Currently it looks so - https://github.com/tarantool/crud/blob/master/crud/compare/comparators.lua
Do you think that something like it could/should be as a part of tuple-keydef module?
Not sure. But if we need to implement some emulation of tuple-keydef methods on tarantool versions, which does not expose symbols necessary for the external tuple-keydef module, we can emulate most of its functionality on pure Lua and place this code to the tuple-keydef module.
We can check, whether necessary symbols are present, in runtime using dlopen() + dlsym().
The only problem I see: we unable to pass such fake key_def to merger, because it extracts and uses struct key_def directly. We can adopt the external tuple-merger, though.
@Totktonada
Your idea looks interesting however I'm not sure that we have time for such activity. Moreover, as far I see we plan to release new LTS version of Tarantool. So it seems to be a time for focusing on new features and stabilization of old ones.
Finally, we can't emulate the same behaviour without key_def. Collations are rare case but in pure Lua but currently we could support only binary, unicode and unicode_ci.