-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MP_EXT] Extension encoder and decoder functions are not exportable #420
Comments
@oleg-jukovec, Looking deeper into the decimal extension implementation, it’s not entirely clear why the connector uses a wrapper for the To give some context to the problem I’m trying to solve: I want to register an encoder and decoder directly on the As an alternative to making decoders and encoders exportable, what do you think about removing the wrapper altogether? This solution would address my use case and align with the approach used for the UUID extension, which doesn’t rely on a wrapper and allows direct encoding and decoding of UUID values in the msgpack extension. |
I don't like the idea to use a types from external libraries as is into the connector: they may be incompatibility in the future or we can find a better type. If the library declares its own types with transform methods, then in the future we can add methods with a new types or declare the old methods deprecated. That is, it is not entirely convenient for the user of the library code, but it is good for the library and its development in the future, backward compatibility etc. The |
Consider making the current MessagePack extension encoder and decoder functions exportable. I’m personally interested in the decimal extension, where I would like to register my own extension but still be able to reuse the encoding logic from the tarantool/decimal package. The easiest way is to simply make the
decimalEncoder()
anddecimalDecoder()
functions start with a capital letter. Another option is to make them adhere to theMarshalerUnmarshaler
interface from vmihailenco/msgpack/v5 and rename them toMarshalMsgpack()
andUnmarshalMsgpack()
, respectively.The text was updated successfully, but these errors were encountered: