Fork me on GitHub
#datomic
<
2022-07-11
>
Drew Verlee03:07:42

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?

steveb8n07:07:08

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.

steveb8n07:07:32

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

steveb8n07:07:09

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

Drew Verlee02:07:59

thanks! Sorry for the late reply.

robert-stuttaford11:07:48

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?

favila12:07:56

In my experience, this happens only if the segments involved need to be regenerated for some other reason

favila12:07:30

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

favila12:07:22

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

favila12:07:35

I think indexing only considers previous index + novel datoms since last index; it won't go through entire tx log

Quentin Le Guennec13:07:36

can I transact an entity in a way that the history of that entity will show the newly transacted entity in the past?

enn17:07:43

No. If you need history to be mutable, you should track that history yourself rather than relying on Datomic history.

favila04:07:56

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