This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-29
Channels
- # announcements (1)
- # babashka (83)
- # beginners (67)
- # chlorine-clover (22)
- # cider (11)
- # circleci (6)
- # clj-kondo (12)
- # cljs-dev (137)
- # cljsrn (15)
- # clojure (124)
- # clojure-europe (40)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (1)
- # clojure-serbia (3)
- # clojure-spec (19)
- # clojure-uk (14)
- # clojuredesign-podcast (5)
- # clojurescript (80)
- # conjure (49)
- # core-async (62)
- # cursive (18)
- # datascript (1)
- # datomic (64)
- # docker (28)
- # emacs (20)
- # figwheel-main (249)
- # fulcro (95)
- # graalvm (2)
- # jobs-discuss (11)
- # joker (2)
- # juxt (4)
- # lambdaisland (9)
- # leiningen (1)
- # meander (14)
- # mount (6)
- # off-topic (16)
- # pathom (46)
- # re-frame (35)
- # reagent (6)
- # reitit (5)
- # shadow-cljs (28)
- # spacemacs (6)
- # sql (18)
- # tools-deps (26)
- # vim (8)
- # xtdb (23)
- # yada (1)
I'm trying to do an index-pull
but running into a Datomic Client Exception:
clojure.lang.ExceptionInfo: Datomic Client Exception {:cognitect.anomalies/category :cognitect.anomalies/forbidden, :http-result {:status 403, :headers {"server" "Jetty(9.4.24.v20191120)", "content-length" "19", "date" "Fri, 29 May 2020 12:34:05 GMT", "content-type" "application/transit+msgpack"}, :body nil}}
at datomic.client.api.async$ares.invokeStatic(async.clj:58)
at datomic.client.api.async$ares.invoke(async.clj:54)
at datomic.client.api.sync$channel__GT_seq.invokeStatic(sync.clj:72)
at datomic.client.api.sync$channel__GT_seq.invoke(sync.clj:69)
at datomic.client.api.sync$eval20791$fn__20808.invoke(sync.clj:113)
at datomic.client.api.protocols$fn__11940$G__11875__11947.invoke(protocols.clj:126)
at datomic.client.api$index_pull.invokeStatic(api.clj:293)
at datomic.client.api$index_pull.invoke(api.clj:272)
I can query the db normally otherwise.Haha, I was under the impression the upgrade was already deployed, but it was still in the pipeline :face_palm::skin-tone-3: . Works now.
The fn is either a fully qualified function allowed under the :xforms key in resources/datomic/extensions.edn, or one of the following built-ins:
I can’t find anything else in the docs that reference extensions.edn. Where can I learn more about that?doubling down on this question, it’s also not clear to me whether the extension function needs to exist on the client’s classpath or the client-server’s classpath
The extensions.edn file needs to be available in the classpath at that relative path (`resources/datomic/extensions.edn`)
if you’re using it inside a transaction function, it would need to be in the transactor cp
Howdy! We just released a fix for Datomic On-Prem Console. The latest release had a bug that caused console to fail to start. https://forum.datomic.com/t/datomic-console-0-1-225-now-available/1472
Is it possible to use a lookup ref in the same transact that creates the unique identity? It seems like the answer is no
i think i’d need more detail If you have one entity being asserted that has a unique ID and another that references it via tempid, Datomic’s entity resolution should handle that correctly whether or not the entity with the unique ID already exists or not. If it does, it will become an upsert, if it doesn’t it will be created
I’m guessing from our earlier conversation that Allen wants to use this with a unique-identity composite attr. I think this doesn’t work unless you assert the composite. e.g. {:db/id "tempid" :attr-a 123 :attr-b 456}
where the upsert attr is :attr-a+b
yes, agreed if you’re upserting you need to include the :attr-a+b
in the transaction
The code is kind of lengthy and it’s late here (London). I’m trying to build a ledger. When inserting transaction items:
{:db/ensure ::accounts/tx-item
::accounts/account [::accounts/account-id (::accounts/account-id i)]
::money/currency (-> i ::accounts/tx-amount :currency keyword)
::money/value (-> i ::accounts/tx-amount :value)}
I’m trying to insert :accounts/account
, in the same transaction as the tx-items. Inserting tx-items fails with
:cognitect.anomalies/category :cognitect.anomalies/incorrect, :cognitect.anomalies/message "Unable to resolve entity: [:griffin.proc.accounts/account-id #uuid \"17af261f-9ad5-58e6-938f-b3b7a0ffee22\"] in datom [-9223301668109421343 :griffin.proc.accounts/account [:griffin.proc.accounts/account-id #uuid \"17af261f-9ad5-58e6-938f-b3b7a0ffee22\"]]"
Right. That’s not convenient because it requires me knowing whether the entity already exists or not, which requires an extra query
[{:account/id "someuniquevalue"
:db/id "foo"}
{:transaction/value 20
:transaction/account "foo"}]
It’s been several years since I used datomic in anger. At the time, the advice was don’t assert facts unnecessarily. Won’t that create new datoms every time, even if the account already exists?
any attr/val pairs that already exist for that entity will be eliminated if the value is identical
if the attr is not present at all on that entity it will assert the attr/value for that entity
not sure where “dont assert facts unnecessarily” would come from certainly doing the work of redundancy elimination has some cost, but i would not expect it to be prohibitive, especially in this case, as you have to “find” the account entity either way, whether it’s via the entity being asserted or with the lookupref
so if everrything you assert is duplicate you’d be accumulating an “unnecessary” couple of datoms
i.e. here and there totally nbd every single minute, 10 times a minute all the time… maybe not so great
The rest of the transaction definitely has to happen and will have novelty, so it sounds like nbd
Hi there, We're currently using datomic cloud and I've been stuck with the following: We have several source applications providing financial data, each one with its own payload, so we decided to have a 'normalizer' service to convert each format to a common payload, so we can build our products in an agnostic manner. To illustrate this:
;;{:source.a/name "John Doe" would become something like-> {:common/name "John Doe"
:source.a/amount 44.50} :common/amount 4450
:common/source {:source.a/name "John Doe"
:source.a/amount 44.50}}
We chose to keep the original format in the final structure to maintain some backtracking and ease integration with legacy systems.
Now, say there is a buggy implementation in this conversion function rounding floats or any other error, and we end up with incorrect values
in the common payload, but we still have the original data. Does datomic have any support for me to bulk 'alter' that data?
The first solution that came to my mind, was to query all the incorrect data, extract the source info, pass it through the correct function, then transact it back
to datomic. But I wonder, does Datomic has any feature to better support that, something closer to a "compare and swap-like" feature?
Thanks to you all, patient readers 😄Datomic has compare and set: https://docs.datomic.com/cloud/transactions/transaction-functions.html#db-cas