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

Filter materialized #384

Closed
wants to merge 1 commit into from
Closed

Conversation

darkleaf
Copy link
Contributor

Would you like to accept this PR?
It's just a draft, if you are ok with it, I'll improve it.

Can you suggest a better implementation?

Also, I use transient, I think I should disable it due to #373.

@@ -223,6 +223,9 @@
(FilteredDB. db #(pred db %) (atom 0))))


(def filter-materialized #'db/filter-materialized)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: doc

@@ -0,0 +1,120 @@
(ns datascript.test.filter-materialized
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: remove unnecessary checks

@tonsky
Copy link
Owner

tonsky commented Jan 26, 2021

Transients are fine, as long as you don’t reuse older values of them. The problem was in the logic in transact-tx-data, not in the transients themselves.

Is this somewhat more efficient than (d/init-db (filter pred (d/datoms db :eavt)))?

@darkleaf darkleaf closed this Jan 28, 2021
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

Successfully merging this pull request may close these issues.

2 participants