datomic

frankitox 2025-09-19T22:13:39.102269Z

Hello 👋 Is it possible to create a d/q query to check that a vector of entities has certain attribute? Something like this, but instead using a vector of ent ids

(d/q '[:find ?e
       :in $ ?e
       :where [?e :some/attr true]]
     db 17592186734126)

Leaf Garland 2025-09-19T22:17:55.956329Z

:in $ [?e ...] then pass in a vector of entity ids.

frankitox 2025-09-19T22:21:25.612149Z

Right, that way I can get a list of entities that match the attribute. But I'd like to return a truthy value only if every entity has the attribute

favila 2025-09-19T22:40:17.752499Z

Compare count of input vs result. If equal, everything matches

frankitox 2025-09-19T22:40:36.331539Z

yep, that seems the basic solution

favila 2025-09-19T22:40:42.174029Z

(Assuming input items are distinct)

Casey 2025-09-19T05:56:47.857309Z

@joe.lane (referencing https://clojurians.slack.com/archives/C03RZMDSH/p1747391001328559?thread_ts=1747385971.572309&cid=C03RZMDSHfrom yours earlier this year ) Do you have any more info about this pattern you could share? I'm particular curious about the details. In particular your use of the term "time shard", I didn't think datomic supported sharding (or we mean different things?). Also AFAIK the latest advice for Pro is that you shouldn't really be running more than one actively-being-written-to database per transactor. I am particularly interested in "sidecar" databases to store queue/job data, ephemeral otp like data etc.

👀 3
👆 2