datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
denis_krivosheev 2018-06-14T04:33:27.000065Z

@petterik the thing is, I am the maintainer of re-posh. Wanted to try rum with it but turns out it’s not that simple. I have an idea of a view and storage agnostic data-management library, but have to verify what we already have.

💯 1
petterik 2018-06-20T16:11:50.000501Z

Oh I didn't know that! 👋

denis_krivosheev 2018-06-14T04:49:06.000192Z

I experimented a little bit yesterday. The idea is, I have the query and I can listen to transactions instead of full database. So when transaction is done and I have its summary, I can execute query against transaction datamos instead of whole database. And If I have any result from it, then rerun the query to the database. Aaand for queries it’s complitely wrong 😔 But maybe can be ok for pull subscriptions. If the transaction has the id we are interested in or a pair of unique props and any of the field from pattern, then rerun pull and rerender subscribed components

denis_krivosheev 2018-06-14T04:54:46.000026Z

Another idea is that subscription itself can declare, which event CAN update subscription’s query. So the logic here 1) When somebody started listen to the query or pull, execute it and put the result into the atom. 2) When event with transaction effect is triggered, find the listening subsciptions (pull or query) and reexecute them 3) Put the new result of execution into the subscription atom

denis_krivosheev 2018-06-14T05:05:05.000037Z

something like

(reg-sub :cool-query-sub
  {:type :query
   :query '[:find ... :where ...]
   :variables [var1 var2]
   :watch-events [:event1 :event2]})
and then (subscibe [:qool-query-sub])