Fork me on GitHub
jeff tang16:06:09

Hi, I noticed that datascript connections have additional key-values like

:schema {}
:eavt #{ }
:aevt #{ }
:avet #{ }
:max-eid 0
:max-tx 536870912
:rschema { }
:hash #object[cljs.core.Atom {:val 0}]
I’m able to access them with the keyword, but when I prn the connection, I only see
#datascript/DB{:schema {}},
               :datoms []}
Does this have something to do with the fact that datascript DBs are records?


yeah, the db type has a custom IPrintWithWriter implementation which defines how its printed


it doesn’t print what the actual object is - those are internal details - but rather an opaque description of what’s in the DB


the nice thing about this is that datascript defines reader literals for #datascript/DB, so you can prn a DB and send it over a remote connection


if it printed it’s internal structure, you probably couldn’t do that

jeff tang16:06:23

wow, thanks so much @lilactown x2