Fork me on GitHub

Datomic Team There is a issue/tracker for this issue?

(let [db-uri (doto (str "datomic:mem://" (d/squuid))
      conn (d/connect db-uri)
      db (d/db conn)]
  (first (d/index-pull db
                       {:index    :avet
                        :start    [:db/txInstant]
                        :reverse  true
                        :selector '[(:db/id :as :not-id :xform clojure.edn/read-string)]})))
selector :as do not work on :db/id, in any context (pull, query-pull, index-pull)... PS: :db/id do not respect ANY param. xform also not work with it.


I opened a support ticket for this as well. I suggest doing the same so they know there’s interest in getting this fixed.

Sam DeSota20:08:51

I'm trying to transact a :db/fn via a custom client that works from javascript, but I'm struggling to get the schema right. I keep getting an error:

Value {:lang :clojure, :params [db eids pull-expr], :code "(map eids (fn [eid] (datomic.api/pull db pattern eid)))", :imports [], :requires []} is not a valid :datomic/fn for attribute :db/fn


You should show your code, but it sounds like you are transactions a map instead of a d/function object


You can make one either with d/function or the #db/fn reader literal

Sam DeSota20:08:40

Yes, I’m transacting a map, I assumed that’s how transit serialized the d/function object. The issue is that I’m doing this from a javascript library that doesn’t have access to d/function, on the transit level how is this object serialized? (using this from javascript is obviously non-standard, but necessary for my org)


I missed that you were using a custom client


You control all of this, so whatever you are doing is what you are doing :)


But when you call d/transact, you need a function object


It’s unclear to me how you made a d/function object from JavaScript?

Sam DeSota23:08:39

I ended up just shifting to putting the txfns in the datomic install classpath

Sam DeSota20:08:10

It's not clear what's missing to correctly transact this function, using the on-prem obviously. Any ideas?