Fork me on GitHub
#datomic
<
2017-03-24
>
wistb02:03:25

hi, just started learning datomic. Is the following picture correct representation of a-usage ?

Lambda/Sierra12:03:01

@wistb That is broadly correct, yes. In addition, both the Transactor and the Peer will communicate with Storage. There isn't really any "transactor" for the in-memory database, it's just the Peer library providing a local version of the d/transact API.

timgilbert14:03:46

Is there an easy way to see what version of datomic a transactor I'm connecting to is?

timgilbert14:03:02

(Like, get it out of the connection object, ideally)

jeremy15:03:26

are tx ids guaranteed to be sequential, or is that an implementation detail?

favila15:03:01

It is really hard to imagine a datomic with non sequential tx

favila15:03:32

Tx is just the t with the tx-partition bits added

jeremy16:03:04

yeah, i understand. though, my question still stands 😉

Lambda/Sierra19:03:11

@jeremy Yes, transaction entity IDs increase monotonically over time. The same is true of any entity ID within its partition.

jeremy19:03:49

ok, thank you!

uwo19:03:37

how would one go about overriding the print-method for db/ids?

Lambda/Sierra20:03:00

@uwo Call class on a dbid, then defmethod print-method

favila20:03:07

@uwo you mean for tempids?

uwo20:03:10

yes. I think maybe what I’m looking to do is more along the line of (. clojure.pprint/simple-dispatch addMethod datomic.db.DbId pprint-myrecord)… I may have been mistaken about print-method..?

uwo20:03:51

basically aiming to pretty print some data that has tempids, but I want to keep the tempids in the format that prn would produce

uwo20:03:58

this was my solution

(defn pprint-myrecord [b] (.write *out* (str b)))

(def my-print (. clojure.pprint/simple-dispatch addMethod datomic.db.DbId pprint-myrecord))

(clojure.pprint/with-pprint-dispatch my-print
  (clojure.pprint/pprint
etc..

val_waeselynck20:03:50

@jeremy note that the ts don't necessarily increase by one from one transaction to the next.

jeremy20:03:20

val_waeselynck: good to know ,thanks