This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-20
Channels
- # aws (7)
- # bangalore-clj (2)
- # beginners (64)
- # boot (34)
- # cider (1)
- # cljs-dev (8)
- # cljsrn (22)
- # clojure (268)
- # clojure-greece (2)
- # clojure-italy (8)
- # clojure-quebec (1)
- # clojure-russia (5)
- # clojure-spec (7)
- # clojurescript (7)
- # consulting (1)
- # cursive (184)
- # data-science (1)
- # datascript (18)
- # datomic (54)
- # dirac (1)
- # emacs (17)
- # graphql (1)
- # klipse (2)
- # leiningen (1)
- # off-topic (17)
- # onyx (10)
- # pedestal (2)
- # reagent (16)
- # spacemacs (4)
- # untangled (3)
- # vim (28)
- # yada (3)
@petrus: That or you can hack together your own solution. I ended up writing a simple sync solution where I create a filtered database for each user and then stream the datoms to them over sente to datascript. I’m not sure how to do optimistic writes though.
How would you go about comparing two datascript database snapshots (d/db conn) in time? I’m want my user to be able to edit data and then I want to send the :db/add
and :db/retract`s to the server to apply the changes. Datomic has d/since
, but it doesn’t appear that datascript does.
@nikki: Just curious. Isn’t it possible to transpile datascript to Objective C (maybe https://developers.google.com/j2objc/)? And it already runs in Java so I guess you could get it working in Android?
@seantempesta interesting
@seantempesta if both snapshots are created by the same process – you could diff based on tx-ids
@misha: Yeah, I’m looking at that. Will that cover retractions though?
or, what I did: you ds/listen!
and just collect txs as db lives on, sending collected tx periodically to server with or w/o reducing them
ds/listen! will cover retracts usecase, but will be a bit more noisy for "hot" attributes: if you change same [e a] multiple times in a row, you'll get multiple txs instead of a single one. But this is reducible, since you have schema available
hmm, not sure I follow the reducible part.
say you have cardinality one :foo/bar
. changing it's value from :a to :b to :c will generate [[- :a][+ :b][- :b][+ :c]], it can be reduced to just [[+ :c]] (if you don't care about separate transactions for undo/analytics purposes)
I haven't gone deeper than this, but maybe it's possible to create something "queryable" from the diffs of the chunks? I don't know. Just re-running the queries when there's been a change has worked fine for me so far