interesting … one thing I can think of that would still be limited is the index - are you still able to look up that entity using the value of that large string in a query?
It seems so, this query returns the expected id
(d/q '[:find ?e
:in $ ?s
:where
[?e :string ?s]]
(get-db)
s)
Datomic Team There is a issue/tracker for this issue?
(let [db-uri (doto (str "datomic:mem://" (d/squuid))
d/create-database)
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'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
It's not clear what's missing to correctly transact this function, using the on-prem obviously. Any ideas?
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
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?
I ended up just shifting to putting the txfns in the datomic install classpath