This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-11
Channels
- # announcements (2)
- # asami (10)
- # aws (2)
- # babashka (28)
- # beginners (103)
- # calva (2)
- # clj-kondo (10)
- # clojure (69)
- # clojure-austin (11)
- # clojure-europe (48)
- # clojure-nl (10)
- # clojure-switzerland (1)
- # clojure-uk (2)
- # clojurescript (6)
- # conjure (2)
- # consulting (1)
- # core-async (2)
- # core-typed (2)
- # cursive (5)
- # datomic (15)
- # jobs (1)
- # malli (4)
- # meander (7)
- # membrane (26)
- # missionary (6)
- # nbb (39)
- # reagent (3)
- # releases (1)
- # ring (3)
- # shadow-cljs (28)
- # spacemacs (2)
- # sql (6)
- # vim (5)
does :db.error/not-an-entity Unable to resolve entity
mean that temporary id the datomic tx e.g :db/id {:part :foo, :idx -1001139}
isn't valid bc there has to be a matching id in another tx like this https://stackoverflow.com/questions/49278607/datomic-db-error-tempid-not-an-entity-tempid-used-only-as-value-in-transacti suggests? Could someone re-phrase "unable to resolve" or give me a hint as to why it can't resolve it?
yep, that’s the reason. you have a “temp” id (which is typically a string) in the txn data but there is no corresponding entity with that same id in the same txn.
typically this means you have an entity with a reference to another entity which is being created in the txn. if the referenced (to be created) entity doesn’t have a matching string :db/id you will get this error
so your statement that the matching id must be in “another tx” is incorrect. any string value in a :reference field must match another entity with that string in :db/id in the same tx
thanks! Sorry for the late reply.
if we set :db/noHistory false
, will indexing backfill historical data too, such that d/as-of will start to see values that were culled by the noHistory behaviour?
In my experience, this happens only if the segments involved need to be regenerated for some other reason
No history only seems to mean “the next time I index this attribute, I won't write old values to the history indexes”. It doesn't actively seek to cull old values or consider that a reason to reindex by itself
Oh you’re talking about turning it off after it's been on. No, I don't think it will regenerate history but I'm less sure
I think indexing only considers previous index + novel datoms since last index; it won't go through entire tx log
thank you
can I transact an entity in a way that the history of that entity will show the newly transacted entity in the past?
No. If you need history to be mutable, you should track that history yourself rather than relying on Datomic history.
There’s one exception only, you can explicitly set the :db/txInstant
of a transaction in the “past” (wall-clock time) as long as there is no existing transaction with a higher value. This is designed for initial imports. https://docs.datomic.com/cloud/transactions/transaction-processing.html#explicit-txinstant
@U09R86PA4 perfect thank you.