Fork me on GitHub

does anyone know how I can update an attribute inside an entity, datomic keeps creating a new entity, which I believe is expected based on what it proposes, however I need to change a string value inside an entity from "todo" to "doing". Is it not the datomic way to look at it?


@brnbraga95 (d/transact conn [[:db/add entity-id :your/attribute "doing"]])


or the slightly more paranoid (d/transact conn [[:db.fn/cas entity-id :your/attribute "todo" "doing"]])


entity-id can be the actual entity id, e.g. (:db/id entity), or a unique reference. based on what you say (“keeps creating a new entity”) I suspect you are using a ref that is not unique?


Does anybody know how can I connect to remote transactor? My URL looks like

But I could not google for where to put transactor’s host and port.


The idea behind that is, before I had a single node with everything installed on it at once: Clojure app, Postgres and Transactor. Now I move them across several nodes. I’d like to have several Clojure app instances that connect to a node that has Postgres + Datomic transactor. Still, my app tries to communicate with local transactor by localhost + 4334.


Solved: the solution was to declare a global IP in transactor properties rather then localhost. Other nodes discover it from the db.


peers connect to storage first, read the transactor location, then connect to the transactor

Ben Hammond13:04:19

is there of list of :db/error values in the datomic docs? I am aware of - :db.error/transactor-unavailable - :db.error/transaction-timeout are there any others (that might be remediable)

Ben Hammond13:04:51

is it reasonable to assume that #{:db.error/transaction-timeout :db.error/transactor-unavailable} are the only two error types that are worth retrying ?


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


I see it now. Hmm, that’s unfortunate.


hi , is there a convinient way to copy a database (in the same storage)? in reading the docs for restore-db it seems that that is not possible with that tool at least