Fork me on GitHub

@didiercrunch — subquery example similar to what you’re asking about here: — useful for clients (one roundtrip), matters less for peer/on-premise use (just chaining queries or doing clojure seq operations is roughly the same as it’s cached locally. I.e., since you’ve realized the segments in memory it doesn’t mean an additional roundtrip).


that looks to be exactly what I wanted!


I'll try it now right now


@didiercrunch You could also make use of the fact how the aggregation function (max …) sorts vectors:

(d/q '{:find  [?artist-name (max ?release-song)]
         :where [[?e :artist-name ?artist-name]
                 [?e :release-date ?release-date]
                 [?e :song-title ?song-title]
                 [(vector ?release-date ?song-title) ?release-song]]}


I’m intrigued by Datomic Cloud, having never used Datomic before, but I’ve read that it doesn’t support excision. My use case is a job application tracking system operating in the EU, which means there’s lots of personal data that the system must be able to “forget” for regulatory reasons. Are there other ways to achieve this in Datomic Cloud?


I may implement something like this soon. The idea is to store sensitive fields in a secondary mutable store and store references to that in Datomic


Interesting. Are you thinking along the lines of just storing the id (int, uuid) of an entity in another database (like Postgres)?


Essentially, it's just storing the values in a secondary KV store and reference them in Datomic via a UUID key. It's actually a tiny bit more complicated than that, because each value must me associated with a person Id so that it can be later deleted.


Does the documented feature of :db.fn/cas to assert the value only if the old value is nil (doesn't exist) apply when the :db/valueType of the attr is a ref? I'm hitting an issue where this doesn't seem to be the case...


[[:db.fn/cas 17592186045451 :gene/biotype nil 67]] ERROR java.lang.IllegalStateException: :db.error/cas-failed Compare failed: 67 java.util.concurrent.ExecutionException: java.lang.IllegalStateException: :db.error/cas-failed Compare failed: 67 Am 100% certain that no value exiists for :gene/biotype for eid 17592186045451.


nm, I my code must have a subtle issue that I'm missing. Managed to prove to myself that the above works in different context. Sorry for the noise.