Hi,
New Datomic user here. I’ve searched but can’t find a definitive answer to this one. We have installed a simple Java function that simply checks that the 3 items passed in are equivalent and returns a boolean. As a test, we would like to have the result of this function stored as a value for an attribute of an entity as we are storing it. This is essentially a case of due diligence/proof-of-concept for us.
Here’s the function source (as simple as it is):
String source = “return (v1.equals(v2) && v2.equals(v3));”
This is installed and works great with a simple invoke()
call.
However, what we wanted to try is something like this:
[ [ :db/add "test-id" :test/bool [ :test/func 1 1 1 ] ] ]
// or:
[ [ :db/add "test-id" :test/bool ( :test/func 1 1 1 ) ] ]
// or even:
[ { :db/id "test-id" :test/bool [ :test/func 1 1 1 ] } ]
(we have tried several different syntaxes all with the same (or similar) result:
:db.error/wrong-type-for-attribute Value [:test/func, 1, 1, 1] is not a valid :bool for attribute :test/bool
I’m assuming we are doing something very wrong … or this is not something that is possible. Are we tilting at windmills?
TIA.