This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-09
Channels
- # asami (10)
- # babashka (11)
- # beginners (24)
- # braveandtrue (1)
- # cider (4)
- # cljs-dev (4)
- # clojure (88)
- # clojure-europe (19)
- # clojurescript (6)
- # code-reviews (7)
- # conjure (2)
- # core-async (2)
- # css (3)
- # cursive (11)
- # expound (81)
- # fulcro (2)
- # hoplon (1)
- # off-topic (42)
- # pathom (1)
- # re-frame (5)
- # shadow-cljs (17)
- # spacemacs (25)
- # testing (6)
- # tools-deps (3)
- # xtdb (12)
Hi! Is it expected behavior for :delete
to leave behind a historical entry with a :crux.db/content-hash
of #crux/id "0000000000000000000000000000000000000000"
?
Hi :) yes that's the marker in the timeline we use to denote the termination of a validity period
I see. And in a situation where you :crux.tx/put
two versions of a document, then :crux.tx/delete
the latest one, is it also expected behavior for entity
to return nil? I would've expected entity
to return the latest version of the document.
Ah I was under the impression that :delete only invalidated a particular version, rather than marking the entire document as deleted. Such that :delete
ing the latest version is like an undo. Is this usecase unsupported?
It's not directly handled as a first-class API operation, but you can use entity-history
to find the N-1 version and put
it once again (and use match
for the active version to ensure consistency, if needed)
Ahh, I was hoping for a way to actually alter the history, as I'm attempting to use the entity-history as a sort of attendance log that can be changed in the event of a mistake. That said, I suppose I can add some additional metadata that ignores certain entries when printing that log
Oh I see, yes it would need to be recorded in some other way, like you suggest. Can you tell me what the domain is that you're working on? Where possible it's usually simplest to model domain-level time concepts as regulate attributes+values, since Crux today doesn't provide a rich query capability across valid time history.
Sorry for the late reply. Oh this is just a silly attendance tracking thing. Though I am looking into Crux for storing GTFS data that can change over time (because transport networks change over time)