tonsky / datascript-transit

Transit handlers for DataScript database and datoms
Eclipse Public License 1.0
104 stars 7 forks source link

Persisting FilteredDB with Transit #8

Open theronic opened 5 years ago

theronic commented 5 years ago

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?

tonsky commented 5 years ago

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