Tuesday, October 15, 2019

Only find-rel elements are allowed in client find-spec

More peer vs client; again from clojarians:

Conversation from slack

I have a syntax question. This is working:
(d/q '[:find (pull ?e [*])
       :where [?e :team/id]] db)
This is not, and is throwing Exception
(d/q '[:find [(pull ?e [*]) ...]
       :where [?e :team/id]] db)
ExceptionInfo Only find-rel elements are allowed in client find-spec
I’m using datomic-pro-0.9.5661
All I changed is the binding form. I see it in both links you sent.
The client only supports the find-rel form. You can use the other binding forms for inputs, but not in the find specification


Datomic client does not support :find [?x] but does support :find ?x

:db.error/not-an-entity Unable to resolve entity: :db/index

When working with Datomic Ions, I wanted to use :db/index on an attribute but got this error:
:db.error/not-an-entity Unable to resolve entity: :db/index

Using the magic of Google I came across this tidbit:


On Datomic Ions Solo, I'm getting an error Unable to resolve entity: :db/index when trying to transact schema

oh, is :db/index not supported on Datomic Cloud?

I guess fulltext indexes aren't either...
Alas, no. And be careful with large strings as well.


It appears that :db/index and :db/fulltext are not support on Datomic Cloud.  The only documentation for this feature is in a slack log from November 2018.

Monday, August 26, 2019

Getting a stack overflow running datomic Ion cast in cider

I was getting a StackOverflowError running this in CIDER while developing with Datomic Ions

For some reason the output stream created ends up being referential with the nrepl PrintStream implementation. Changing it from :stdout to :stderr seems to solve the problem: