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

Refactor to remove view_viersions #112

Closed
ecton opened this issue Dec 6, 2021 · 1 comment
Closed

Refactor to remove view_viersions #112

ecton opened this issue Dec 6, 2021 · 1 comment

Comments

@ecton
Copy link
Member

ecton commented Dec 6, 2021

In an effort to simplify things, I realized that now that Collections are mature enough, there's no real benefit to using the view_entries tree separately from the Database collection.

We should move the collection of view version information into the Database type, and remove the view_versions_tree. If this ships after alpha 1, we should consider removing the old tree if it exists.

This may be a replacement for #26, or just a partial implementation.

@ecton ecton added the local label Dec 6, 2021
@ecton ecton added this to the v0.1.0 milestone Dec 6, 2021
@ecton ecton added this to To do in Khonsu Labs Roadmap via automation Dec 6, 2021
@ecton
Copy link
Member Author

ecton commented Dec 14, 2021

This turns out to be "impossible" -- maybe not quite impossible, but not worth it. The reason is that the Database schema type has a unique view. Upon saving a Database record, the view must be updated -- which requires that the integrity scanner has succeed for the ByName view.

The act of updating the version state requires updating that view, which means that the integrity scanner deadlocks. There are alternate approaches, but they would end up creating a new tree file on disk anyways, negating the benefit of the refactor.

@ecton ecton closed this as completed Dec 14, 2021
Khonsu Labs Roadmap automation moved this from To do to Done Dec 14, 2021
ecton added a commit that referenced this issue Dec 14, 2021
This provides a similar goal as the entry() API, but on documents that
were fetched at some point in the past. This was originally written as
part of an attempt to tackle #112, before realizing a fundamental issue.

This function is useful, however, so I finished adding a unit test and
decided to ship it. If you are storing a document that you've retrieved,
and you wish to perform some edits and update it, you can use this API
to edit the document in such a way that if the document has been updated
before your edit, the document will be fetched and your callback will be
re-invoked with the current document.
@ecton ecton removed this from the v1.0 milestone Jan 20, 2022
@ecton ecton removed the local label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant