-
Notifications
You must be signed in to change notification settings - Fork 25
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
custom serializers #109
Comments
Incognito only works for record types. You need to use the low level serializers of the specific serialization library you are using unfortunately, e.g. Fressian. Note: Maybe it should support LocalDateTime directly. |
Thanks @Wilo! |
The below code works. It extends fressian serialization for LocalDateTime and Instant.
|
Cool! I don't know about Fressian itself, but maybe upstream is interested in covering this. As far as I know date support has expanded to these new types on the JVM and ideally Fressian could also cover them. |
I would like to add a few comments: I am using datahike and konserve for a production app to manage workflows in my company. Both datahike and konserve are stable. A big thanks to @whilo and all the others. The reason for me diving into the serializer hell was because konserve was throwing errors when serializing localdate. What made it difficult is that there is (almost) no readme for serializers. The best example is a unittest in konserve. The default filestore needs the serialization/deserialization wrappers in an atom. I wanted to do a quick and dirty solution to serialize all date typed to string (str d). Another confusing thing is default-serializers and incognito. In the konserve code there are two different tyoe of serialization params.. I guess one to add tyoes to incognito and one to add types that implement custom serialization functions. |
From konserve.serializers:
There are read-handlers and custom-read-handlers. It is completly unclear what is the difference. |
@awb99 Incognito was my best effort attempt to abstract serialization of custom Clojure defrecords for different serialization formats. I put the handlers into atoms so you could install new handlers in operation, a feature that might make sense in replikativ, but is not really that important. Unfortunately many custom JVM types are not defrecords and that is why the custom serializers exist to allow to directly install custom handlers for the specific serialization library you use (for us currently Fressian). I agree that this is unfortunately not well documented. @pkpkpk Thanks for looking into this! |
Hi!
I need to add a few more types so that konserve can store them.
I would like to use incognito to write simple conversion routines.
I got this to work
However I struggle to create a konserve store that writes LocalDateTimes.
This does not work:
Any ideas?
The text was updated successfully, but these errors were encountered: