Fork me on GitHub
#datascript
<
2021-06-27
>
mathpunk19:06:46

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[]}")

mathpunk19:06:42

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

quoll20:06:00

you need to quote the keys in that map

quoll20:06:29

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[]}")

quoll20:06:12

sorry if that’s an abrupt answer. I’m a bit tired. I hope it helped though

mathpunk20:06:30

it looks like a great answer that i won't have time to validate right now but i will. thank you!

mathpunk19:07:23

:thumbsup::skin-tone-2: 🎉