den1k / subgraph

Reactive graph database for re-frame
Other
78 stars 2 forks source link

Removing entities #11

Open julienfantin opened 7 years ago

julienfantin commented 7 years ago

Removing entities can be achieved with (dissoc db (ref-to db my-entity)).

This is undocumented and it is a subtle operation, because:

If db-level consistency is desirable, we could maintain an index during add and remove that'd allow a fast reverse lookup on the removed ref, to the refs and attributes pointing to it:

{<ingress-ref> {<egress-ref> <from-attr>}}

This would give us a add and remove operations in time linear to the number of joins.