Fork me on GitHub
#datascript
<
2019-05-15
>
anovick13:05:55

Hi! When serializing a DataScript conn with pr-str I see that all :datoms tuples have a fourth value 536870913 e.g. [3 :tag/name \"Clojure\" 536870913] Since DataScript doesn't maintain a transaction log, is this just a placeholder value that has no use whatsoever?

danielstockton13:05:16

It's still queryable, and you can maintain your own transaction log.

danielstockton13:05:39

I'm sure it has more utility, but can't think atm

anovick13:05:44

I have another question regarding serialization: When I pr-str an empty db it gives me a nice format:

(pr-str (d/empty-db)) 
; => "#datascript/DB {:schema {} :datoms[]}"
But when I serialize a conn I get this format:
(pr-str conn)
; => "#object[cljs.core.Atom {:val #datascript/DB {:schema {...} :datoms [...]}}"
How can I serialize this Atom object with the first format?

danielstockton13:05:05

The conn is just an atom holding the db value

anovick13:05:18

ahh that makes sense 🙂

anovick13:05:05

yea that works just fine now, thanks again @danielstockton

👍 4
lilactown15:05:17

I was actually wondering yesterday, since it maintains the txid, how hard it would be to create an as-of function if you maintained timestamps of transactions

lilactown15:05:24

I assume someone must have done this before?

chrstphrhrt17:05:52

hey, just discovered datascript.. do people consider it a viable open source alternative to datomic?

Daniel Hines17:05:16

It lacks persistence. Datahike is aiming to be more in that space.

👀 4
Daniel Hines17:05:35

Or, rather, lacks durability.

urzds19:05:40

Hi! Is there a version of the . operator to :find that will blow up if more than one result was found instead of silently discarding every result but the first?

kenny19:05:14

No. Pretty easy to write a function that does this.