is there any way to use `kotlin.serialization` fo...
# ktor
n
is there any way to use
kotlin.serialization
for the Sessions feature? in particular how the data class is turned into some sort of string.. whni i extend
SessionStorage
to store those strings in postgres, i would like to have json or structured data instead of however it serializes fields
c
here's an example of how to do it with gson... not sure about kotlin serialization https://ktor.io/servers/features/sessions/serializers.html
n
oh thats a feature i did not see.. then its quite possible.. i just need to pass along the Serializaer type and blindly cast .. which is fine since its only 1 type ever and if it fails i treat it as if it never did anything
so is there any way to shortcircuit this
T
->
String
->
ByteWriteChannel
->
Storage
? ideally i would want to just directly write and read T into a database and access its different fields and pass that to a
INSERT
via exposed
Is there any reason for me to not just write and read from database in
SessionSerializer
and do nothing in
SessionStorage
?
except i guess the invalidate function is on the storage