custom serialization not working
I tried to plugin my own custom serailisation using nippy as documented here: https://github.com/replikativ/konserve/blob/main/doc/api-walkthrough.md#connecting-stores
but I got an NPE, which seems to related to this line: https://github.com/replikativ/konserve/blob/8e96b4648599c42a93bb0e2e1779fccc4194f81b/src/konserve/serializers.cljc#L79
which seems to list all potential classes implementing PStoreSerializer
I get a nil here: https://github.com/replikativ/konserve/blob/8e96b4648599c42a93bb0e2e1779fccc4194f81b/src/konserve/impl/storage_layout.cljc#L26
as now serializer-id is found for my own class.
can you share you connect-store call and serializer?
I worked arround it by creating bytes first via nippy, and save those via konserve.
Lets see if find the code back.
If you want to add a serializer you need to open a PR. The serializer are internally mapped into a lookup table like this to allow store schema updates for konserve, that is why adding it to the codebase is reasonable. Nippy would definitely be nice to have for the JVM. I focused on formats that also work in JS so far, but not everybody needs that.
Thnaks, I thought so after reading code. But then this should maybe reformluated: https://github.com/replikativ/konserve/blob/32b7f253a5ec76b9dfcb177a58cdbf76fb006a51/doc/api-walkthrough.md?plain=1#L64
"custom serializer" sounds like "custom defrecord", while you mean "custom configuration/handler"
To add "nippy" would be nice, but needed to be very configurable. In a lot of case a user would need to configure custom " safe classes" for de-serialization of Serialised java classes.
So you are saying that this cannot be passed in as a read and write handler to the serializer? Currently it works by defining stateless serializer constructors, but they then can be parametrized by such custom handling code.
The reason for this is that konserve allows to change serializers without having to reserialize the whole store. It keeps a mapping per key to make sure that a value can always be read, even if the store serializer was different when it was written. You still need to provide the handlers though if you want it to be read in particular way.