Fork me on GitHub
#datomic
<
2015-06-19
>
frankiesardo14:06:03

What would be the idiomatic way of getting the time of creation of the db? Sort of like the opposite of basis-t

frankiesardo14:06:04

(d/q '[:find [(min ?inst)] :where [?tx :db/txInstant ?inst]] db) doesn't work because there's always a transaction set at the epoch

Lambda/Sierra14:06:03

frankie: I don't think the "time of creation of the DB" is stored anywhere. The best you could do is "time the first user-space entity was created."

frankiesardo15:06:15

@stuartsierra: What would the query look like?

Lambda/Sierra15:06:22

@frankie Or just get the txInstant from the first transaction returned by (d/tx-range (d/log conn) nil nil)

frankiesardo15:06:52

Just discovered that min actually takes an optional n parameter, so I could jus drop the first returned from (d/q '[:find [(min 2 ?inst)] :where [?tx :db/txInstant ?inst]] db)

frankiesardo15:06:37

@stuartsierra: can't use d/log, I have db as a value passed down from other fns. That was another good idea tho