datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
urzds 2019-05-22T11:50:01.200700Z

Is there something like an overlay database for DataScript? I have some data that is permanent and which I would like to persist. Then there is some data which is more or less temporary to that run on my program and should not be persisted and thus not "stain" the nice clean permanent data. For convenience it was nice so far to be able to retrieve all data of one entity (i.e. the permanent and the temporary part of it) with just one (-> d/q d/pull). Combining these wishes, I think having the temporary data as an overlay over the permanent one would satisfy them. Does something like this exist?

2019-05-22T12:35:02.201500Z

You could maintain two datascript DB’s and combine them with d/with.

urzds 2019-05-22T22:16:17.202700Z

@d4hines So something like (let [temp-db (:db-after (d/with db [{... temp-changes ...}]))] ...)?