Fork me on GitHub
#datomic
<
2017-03-02
>
eraserhd02:03:09

OK, here's a tx syntax question: How does datomic decide whether something in an entity map's value is a lookup ref or a list of two items, the first being referred to by :db/Ident and the second by eid?

eraserhd02:03:43

E.g. {:a/b [:c/d 42]}

matthavener03:03:45

the cardinality of :a/b in the schema

lucasbradstreet21:03:41

Hi everyone. I’m working on onyx-datomic’s log reader, and I recently changed it so that it wouldn’t just call (d/tx-range last-tx nil) with an open end range, since I was a bit worried it might not read the txes lazily. The problem is that I don’t have a good way to ask “what’s the max tx id for the next 10 transaction”. Is this a job for a query?

favila21:03:46

tx-range is supposed to be lazy

favila21:03:12

I'm trying to think of another way to answer your question that isn't just (->> tx-range (drop 9) first :db-after d/basis-t)

lucasbradstreet22:03:47

bkamphaus 19:05:40
<@U05120CBV> and <@U0509NKGK> I believe the premise in Onyx documented as: "relies on the fact that tx-range is lazy” is not true.
marshall 19:05:51
i think you’re right

favila22:03:03

I'm pretty sure it's lazy. (tx-range log nil nil) on a large db does not act like it's realizing everything.

favila22:03:31

I have an alternative though

lucasbradstreet22:03:49

Yeah, that’s what I was originally assuming. That was quick for me too.

favila23:03:39

That is my attempt

favila23:03:49

@lucasbradstreet I improved it, added some more paranoia, dropped the need for partition-key-by

favila23:03:03

verified it gives same results as tx-range

favila23:03:18

(but I still think tx-range is lazy)