does Datomic Cloud have a REST API similar to on-prem? https://docs.datomic.com/on-prem/rest.html
Are EntityIDs in Datomic something we can use as "user space" identifiers or shall we use our own?
you should use domain identifiers
there are a variety of reasons not to expose entity IDs to your applications layers as user-space identifiers
if there isn’t a straightforward choice for an identifier in your particular domain, you can always generate a UUID for entities and just use that
Fair. Thanks.
:thumbsup:
Is there a way to get the created id without having to re-query? I can see there is a tempId field but it's empty
This is the current schema I am using
Oh ok my mistake, it is not autogenerated, I'm still responsible for generating it
right, and the :tempids
map will return the mapping between actual assigned entity IDs and the tempids you supply
when/if that’s relevant
Ok, I guess I'll have to use a regular java.uuid to get my number; was hoping Datomic would handle the ids for me somehow but that ain't a problem
I am almost sure it does not; you can build one with Java/Clojure that would internally use the client API
What is the best practice about the schema? Do you usually transact it every time the application starts? Or only when running a "migration"?
can i use :db/cas
to swap an attribute value for one that is missing to one that is present (and vice versa), or is it only compatible with swapping two "non-nil" values?
(d/transact conn {:tx-data [[:db/cas 12345 :reader/nickname nil "joshkh"]]})
=>
entity, attribute, and new-value must be specified
i suspect i'll have to roll out my own transactor function for that?huh, thanks for pointing that out. i thought i tried that... sure enough nil to non-nil works. thanks!
i haven't looked through the code, but this NodeJS library claims to be cloud compatible, so perhaps there is an accessible rest API? https://github.com/csm/datomic-client-js
The old value can be nil (per doc): "You can use nil for the old value to specify that the new value should be asserted only if no value currently exists."
Someone can help me? I want to restore my backup but I've got this problem
java.lang.IllegalArgumentException: :restore/collision The name 'db-dev' is already in use by a different database
I deleted folder data from datomic/