Fork me on GitHub
#datomic
<
2020-04-21
>
tatut12:04:47

anyone have datomic cloud db using tests running on github actions? my build can't find the ion jars, IIRC there was some region restrictions in accessing the s3 release bucket

pvillegas1214:04:15

Is there a way to query for all datoms affected by a transaction? I can find datoms that are affected from a given transaction which are associated with a particular entity like this:

(d/q '[:find ?attr ?value ?txid
       :in $ ?txid ?entity
       :where
       [?entity ?attr ?value ?txid]
       ]
  (d/history (d/db (cloud-conn))) 13194140275534 69102106782505590)

pvillegas1214:04:56

If ?entity is not bound, I get a Insufficient binding of db clause: [?s ?attr ?value ?txid] would cause full scan

pvillegas1214:04:22

@marshall Thank you, that’s exactly what I needed 😄 😄 😄

armed18:04:24

Hello everyone.

(first (d/query
          {:query '{:find [(boolean ?u) ?passwords-equals ?active]
                    :keys [login-correct?
                           password-correct?
                           user/active?]
                    :in [$ ?login ?password]
                    :where [[?u :user/login ?login]
                            [?u :user/password ?pwd]
                            [?u :user/active? ?active]
                            [(= ?password ?pwd) ?passwords-equals]]}
           :args [src-db login password]}))

armed18:04:04

Why this code does not work (empty)? But It returns data when I replace last clause with [(.equals ?password ?pwd) ?passwords-equals]]

armed18:04:38

Why = is not treated like function expression?

favila18:04:01

My guess is it’s a special form for performance. It’s already not the standard clojure.core/= function.

favila18:04:17

!= is another one

armed18:04:06

Thanks. Official docs doesn't mention this.

armed18:04:24

BTW, = works as expected if ?password equals to ?pwd, but fails when otherwise.

armed18:04:20

(clojure.core/= ?password ?pwd) works as expected