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
https://github.com/tonsky/datascript/blob/master/src/datascript/db.cljc#L441
https://github.com/tonsky/datascript/blob/master/src/datascript/db.cljc#L722
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
wow, thanks so much @lilactown x2