Fork me on GitHub
#datascript
<
2021-10-21
>
Jack Park22:10:25

I am looking at some datoms made by Datascript inside Athens. I'd like some help decoding them: [1,"^:",2,536870913]], ["^@",[1,"^:",3,536870913]], ["^@",[1,"^:",5,536870913]], ["^@",[1,"^:",44,536870913]], ["^@",[1,"^3","0",536870913]], ["^@",[1,"^6","Welcome",536870913]], ["^@",[1,"~:page/sidebar",999,536870913]], ["^@",[2,"~:block/open",true,536870913]], ["^@",[2,"~:block/order",0,536870913]], ["^@",[2,"~:block/string","Welcome to Athens, Open-Source Networked Thought!",536870913]], ["^@",[2,"^3","ee770c334",536870913]], I gather that the last number is the transaction timestamp. What is curious is the emergence of the list element "^@"; the rest seem to be E, A, and V, though the "^3" and others like that don't make sense on the A value. I'm guessing that the ^@ is the added? marker?

zane22:10:43

I don’t have an answer for you here, but I bet the folks in the Athens Discord would gladly help you out with this.

jjttjj22:10:25

Looks like it might be transit, but I'm not 100% sure https://github.com/cognitect/transit-clj

Jack Park23:10:41

could well be transit - Athens uses datsync which uses transit. Thanks!

pithyless10:10:31

@U0288B00494 you can use datascript.transit/read-transit-str to get back an EDN structure; alternatively sometimes https://github.com/borkdude/jet is useful to jump between edn/json/transit

pithyless10:10:00

and you may also be interested in this: https://github.com/tonsky/datascript-transit/blob/master/src/datascript/transit.cljs#L23-L25 - the library stores data as [e a v tx (optional added?)]

Jack Park00:10:27

Ok. It's transit. Studying the docs to figure out the added symbol. Thanks!