crud icon indicating copy to clipboard operation
crud copied to clipboard

Merge "key_def" and "comparators" into single cross-version comparator module

Open olegrok opened this issue 4 years ago • 4 comments
trafficstars

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

olegrok avatar Jun 08 '21 10:06 olegrok

Maybe as part of the tuple-keydef module itself?

Totktonada avatar Jun 08 '21 10:06 Totktonada

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?

olegrok avatar Jun 08 '21 10:06 olegrok

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 avatar Jun 18 '21 23:06 Totktonada

@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.

olegrok avatar Jun 21 '21 07:06 olegrok