datascript-transit icon indicating copy to clipboard operation
datascript-transit copied to clipboard

Persisting FilteredDB with Transit

Open theronic opened this issue 6 years ago • 1 comments

I'm having a hard time persisting a filtered DB because (:eavt db) does not seem to return filtered datoms for a FilteredDB.

I tried (seq db) as per https://github.com/tonsky/datascript/blob/master/src/datascript/db.cljc#L542, but doesn't seem to work (I could be doing something wrong).

In particular, I want to store some JavaScript objects locally but not persist them to localStorage. I spent several hours trying to filter out the offending datoms, but I couldn't get around the sort performance cost of having to call (d/conn-from-datoms filtered-datoms some-schema).

How would you go about elegantly excluding certain attributes when serialising with Transit?

theronic avatar Oct 19 '19 08:10 theronic

What about (datoms db :eavt)? What doesn’t work, exactly?

tonsky avatar Oct 21 '19 14:10 tonsky