datomic

braai engineer 2025-09-22T13:19:45.123869Z

Is this the right way to use missing? in an OR clause?

(d/q '[:find [(pull ?rel [*]) ...]
         :in $
         :where
         [?rel :eacl.relationship/resource-type]
         ; ide
         (or-join [$ ?rel]
           [(missing? $ ?rel :eacl.relationship/subject)]
           [(missing? $ ?rel :eacl.relationship/resource)])]
    db)
Plain OR throws Cannot resolve key: missing?, e.g.
(or
  [(missing? $ ?rel :eacl.relationship/subject)]
  [(missing? $ ?rel :eacl.relationship/resource)])

jaret 2025-09-22T13:25:33.556929Z

Yes, that is correct syntax. or-join will bind the required variables in the join clause. Whereas or will not have the variables needed to allow predicate functions like missing?. https://docs.datomic.com/query/query-data-reference.html#or-join

jaret 2025-09-22T13:27:32.875049Z

That being said, I'd love to understand logically what you are trying to achieve. While the query will execute I am not sure missing? is going to give you what you are after. It returns true if the entity has no value for attribute in the database. So are you searching for any results that do not have a subject or resource?

favila 2025-09-22T13:28:05.456409Z

Drop the $ from the or-join’s first clause (the var list)

πŸ‘ 1
favila 2025-09-22T13:28:15.506639Z

$ is a data source not a var

favila 2025-09-22T13:29:09.076889Z

(Or-join [?rel] [(missing? $ …)] …)

πŸ‘ 1
2025-09-22T20:06:41.785489Z

I think com.datomic/ion-dev {:mvn/version "1.0.326"} (the latest version, i believe) uses an old version of tools.deps which doesn't allow :git/sha to be used in git dep coordinates, only :sha can be used. So when my ions app has any transitive deps that uses :git/sha, I can't push it. Is there a better place to report this?

clojure -M:ion-dev '{:op :push :uname "wip"}'


{:command-failed "{:op :push :uname \"wip\"}",
 :causes
 ({:message
   "Library org.clojure/data.xml has missing :sha in coordinate.",
   :class ExceptionInfo,
   :data
   {:lib org.clojure/data.xml,
    :coord
    #:git{:url "",
          :sha "7cccbbbf913f55eb954f461cd2f222a231ebeee0"}}})}

Joe Lane 2025-09-22T20:45:37.360259Z

We're already aware of it and putting the finishing touches on a much-needed upgrade @jjttjj

πŸŽ‰ 1