This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-27
Channels
- # announcements (8)
- # babashka (7)
- # beginners (24)
- # biff (5)
- # calva (17)
- # cider (1)
- # clj-kondo (4)
- # clojure (61)
- # clojure-europe (5)
- # clojure-norway (19)
- # clojurescript (17)
- # conjure (1)
- # core-typed (14)
- # cursive (9)
- # datomic (7)
- # events (2)
- # figwheel (2)
- # helix (1)
- # honeysql (4)
- # jobs (3)
- # lsp (3)
- # malli (2)
- # nrepl (13)
- # off-topic (9)
- # pathom (6)
- # pedestal (3)
- # polylith (3)
- # portal (7)
- # reagent (4)
- # reitit (2)
- # shadow-cljs (49)
- # tools-deps (8)
- # vim (3)
Q: I want to query “last-updated” date-time for n entities. it’s not obvious how to do this because a change to any attribute in the entity is an “update”. has anyone found a way to do this?
I have done that for parent entities when children are updated. why model this instant value when it is in history?
fair enough. having thought about it a bit, I’m going to follow your advice. thx for the nudge
PS. Don't forget that two (Date.)
may be equal, i.e. refer to the same millisecond.
Thus if you are asserting:
:e/updated (Date.)
twice fast enough on the same entity, you may loose data.
If you are not loosing data now, you may in the future as latency decreases.
I'm not sure it's a very good idea to explicitly model this.
To me it seems this should be something that Datomic "can do".
I have solved this (for certain types of data) in https://github.com/ivarref/rewriting-history. You can have a look at the function pull-flat-history
.
This allows you to get the (relative) latest update of some entity.
Warning. I'm pretty sure pull-flat-history
is slow.