Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing entities #11

Open
julienfantin opened this issue Aug 2, 2017 · 0 comments
Open

Removing entities #11

julienfantin opened this issue Aug 2, 2017 · 0 comments

Comments

@julienfantin
Copy link
Contributor

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

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

  • It will leave dangling refs in entities who join my-entity
  • During query parsing pull ignores refs and colls of refs that do not resolve
  • Essentially using pull gives the expected result, but the db is an inconsistent state.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant