This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-31
Channels
- # announcements (2)
- # babashka (145)
- # beginners (260)
- # calva (17)
- # chlorine-clover (7)
- # clj-kondo (9)
- # cljsrn (1)
- # clojure (88)
- # clojure-dev (65)
- # clojure-europe (31)
- # clojure-france (4)
- # clojure-nl (4)
- # clojure-uk (61)
- # clojuredesign-podcast (1)
- # clojurescript (31)
- # code-reviews (1)
- # cursive (32)
- # data-science (2)
- # datascript (9)
- # datomic (39)
- # docker (3)
- # events (1)
- # figwheel (95)
- # figwheel-main (4)
- # fulcro (17)
- # kaocha (2)
- # keechma (1)
- # malli (1)
- # meander (35)
- # nrepl (4)
- # off-topic (1)
- # pathom (8)
- # re-frame (4)
- # reagent (8)
- # reitit (3)
- # releases (1)
- # remote-jobs (2)
- # shadow-cljs (182)
- # sql (30)
- # tools-deps (89)
- # xtdb (31)
Is there a way to have historical version of the database in datascript?
Something like two transactions ago?
Datascript Databases are persistent datastructures, just like regular ol clojure data
So if you take d1
, use (d/with-tx ...)
(or whatever; forget the exact function), you get a new db d2
which shared structure with d1
, but remains a separate referenceable value.
Datascript conn
s are just simple atom
containers with just a bit of extra metadata.
It doesn't do any historical tracking other than what an atom
would do. But you could easily come up with your own state management that kept references to snapshots on whatever basis you like.
If you got fancy enough, you might even be able to bake it into a regular conn
atom's metadata, the way that posh
does.
More straightforward: just write a couple of api functions for abstracting over all of this (`http://my.wild.app/transact`, etc)