Fork me on GitHub
#datomic
<
2018-02-05
>
bkamphaus01:02:54

@didiercrunch — subquery example similar to what you’re asking about here: https://groups.google.com/d/msg/datomic/5849yVrza2M/31--4xcdxOMJ — 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).

didiercrunch02:02:49

that looks to be exactly what I wanted!

didiercrunch02:02:13

I'll try it now right now

jocrau05:02:22

@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]]}
       db)

msolli08:02:44

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?

val_waeselynck09:02:39

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

msolli10:02:01

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

val_waeselynck13:02:50

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.

mgrbyte12:02:21

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...

mgrbyte12:02:14

[[: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.

mgrbyte13:02:03

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.