I'm trying to read someone else's serialization of some datascript and I don't really know how reader functions work. I think I'm supposed to be able to do this w/o error:
(edn/read-string {:readers {datascript/Datom datascript.db/datom-from-reader
datascript/DB datascript.db/db-from-reader}} "#datascript/DB {:schema {} :datoms[]}")
Chances are they are using https://github.com/tonsky/datascript-transit
but those names aren't found and I'm not sure if it's because I'm making a newbie mistake with data-readers, a newbie mistake with requiring namespaces, or these names are no longer correct
you need to quote the keys in that map
So that they’re namespaced symbols:
(edn/read-string {:readers {'datascript/Datom datascript.db/datom-from-reader
'datascript/DB datascript.db/db-from-reader}} "#datascript/DB {:schema {} :datoms[]}")
it looks like a great answer that i won't have time to validate right now but i will. thank you!
:thumbsup::skin-tone-2: 🎉
sorry if that’s an abrupt answer. I’m a bit tired. I hope it helped though