Fork me on GitHub
#datascript
<
2019-05-22
>
urzds11:05:01

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?

Daniel Hines12:05:02

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

urzds22:05:17

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