-
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
feat(iroh-sync): Queries and "views" #1766
Conversation
I think you need to rebase 😅 lots of conflicts |
yes will do, started hacking away on #1701 |
iroh-sync/src/store/fs.rs
Outdated
|
||
// Records by key | ||
// Key: (NamespaceId, Key, AuthorId) | ||
// Value: same as in RECORDS_TABLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we be duplicating the full value here? seems like we could should store a reference to the records table (not sure how to and if that is actually better..)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, not sure myself. It's one extra lookup vs. 156 bytes (value size) per entry.
In the most recent commit, I changed it to not duplicate the value but instead do the extra lookup.
…ntries, query single entry on client (#1772) ## Description * 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` Based on #1766 ## 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.~~
I merged main and solved the conflicts from #1770. Also added This is now ready to go from my side. |
Description
Implementation of #1667, extends #1701
With the following changes after discussions in Discord:
Query
structIn the process I did a refactoring of the redb store to be safer to use. Especially, I moved the
ouroboros
self-referencing stuff into aranges
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 :
get_one
toget_exact
get_exact
whether to include empty entries or notget_one
toiroh::client::Doc
to get a single entry with the same query mechanisms asget_many
Open questions and tasks:
Notes & open questions
Change checklist