-
Notifications
You must be signed in to change notification settings - Fork 163
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
[WIP] Querys & Views #1701
Closed
Closed
[WIP] Querys & Views #1701
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dignifiedquire
force-pushed
the
feat-query-view
branch
from
October 23, 2023 12:22
24d4406
to
b238cc4
Compare
3 tasks
Closing in favor of #1766 |
github-merge-queue bot
pushed a commit
that referenced
this pull request
Nov 7, 2023
## Description Implementation of #1667, extends #1701 With the following changes after discussions in Discord: * Remove the notion of views, instead embed the info in the query. If the high-level concept of views makes more sense for people from an API perspective, we can restore it in the client api. However under the hood the query details are different per view, this is why here I expose a single `Query` struct * Add a query builder with a typestate to only allow possible combinations * Add an index to the redb (fs) document store to make queries that are sorted by key, or that are filtered by key but not by author, efficient. This also is what allows to do queries for the "latest only" entry per key, without allocating the full result set. In the process I did a refactoring of the redb store to be safer to use. Especially, I moved the `ouroboros` self-referencing stuff into a `ranges` module, and encapsulated in an inner type to keep the self-referencing compilcations scoped. Also did something I had mind for a while: Add some type-safe abstractions around the range bounds constructions that are used when selecting on redb tables. All this turned out quite nice, IMO. Also contains the changes from #1772 : * Renames `get_one` to `get_exact` * Add flag to `get_exact` whether to include empty entries or not * Add `get_one` to `iroh::client::Doc` to get a single entry with the same query mechanisms as `get_many` Open questions and tasks: * Naming review of the query builder methods * Integration of the query parameters in the console ## Notes & open questions <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant. - [ ] Tests if relevant. --------- Co-authored-by: dignifiedquire <me@dignifiedquire.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Implementation of #1667