This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-12
Channels
- # aleph (8)
- # announcements (9)
- # babashka (15)
- # beginners (91)
- # calva (54)
- # chlorine-clover (3)
- # cider (25)
- # clj-kondo (9)
- # cljfx (4)
- # cljsrn (12)
- # clojure (40)
- # clojure-australia (2)
- # clojure-europe (77)
- # clojure-nl (10)
- # clojure-spec (22)
- # clojure-uk (9)
- # clojurescript (39)
- # conjure (12)
- # cursive (8)
- # datascript (17)
- # datomic (22)
- # emacs (2)
- # expound (6)
- # fulcro (25)
- # kaocha (7)
- # malli (9)
- # meander (5)
- # off-topic (13)
- # pathom (8)
- # pedestal (5)
- # portal (1)
- # rdf (58)
- # re-frame (65)
- # reagent (15)
- # sci (3)
- # shadow-cljs (50)
- # test-check (6)
- # testing (3)
- # tools-deps (1)
- # vim (7)
- # xtdb (10)
does Datomic Cloud have a REST API similar to on-prem? https://docs.datomic.com/on-prem/rest.html
I am almost sure it does not; you can build one with Java/Clojure that would internally use the client API
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
Are EntityIDs in Datomic something we can use as "user space" identifiers or shall we use our own?
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
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
right, and the :tempids
map will return the mapping between actual assigned entity IDs and the tempids you supply
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
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?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."
huh, thanks for pointing that out. i thought i tried that... sure enough nil to non-nil works. thanks!