-
Notifications
You must be signed in to change notification settings - Fork 277
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(queries)!: Query projections #5242
Merged
Merged
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
DCNick3
requested review from
s8sato,
mversic,
SamHSmith,
outoftardis,
0x009922 and
dima74
as code owners
November 18, 2024 08:53
DCNick3
force-pushed
the
query-projections
branch
from
November 18, 2024 09:50
56ed397
to
3965e8c
Compare
DCNick3
force-pushed
the
query-projections
branch
from
November 18, 2024 14:59
99801df
to
241c3ce
Compare
s8sato
reviewed
Nov 20, 2024
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.
Insightful and well-planned work. Very little to comment on
DCNick3
force-pushed
the
query-projections
branch
from
November 22, 2024 07:08
8411d38
to
76122e0
Compare
This is done in preparation of landing query, projections, which will share some of the types with the predicates. The API is mostly the same, with some fields in prototypes being renamed to mirror the actual data types Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
For now iroha only produces 1-tuples, but the client code can already receive actual tuples and downcast them into iterators over typed tuples Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
This will let the user select (possibly multiple) projections of the object being queried. The selectors are ignored for now though Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
…he selector in core Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
This is more natural for humans than the columnar format iroha uses in transit Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
mversic
force-pushed
the
query-projections
branch
from
November 26, 2024 12:05
76122e0
to
81a4dec
Compare
mversic
approved these changes
Nov 26, 2024
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.
Incredibly powerful stuff. Great API design.
s8sato
approved these changes
Nov 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Context
Closes #5063. Helps to continue #4933.
Some of the singular queries are there to select a small sub-object (like
FindXxxMetadata
queries). A solution is needed for the iterable queries to do the same.Solution
A projection system, which allows one to query a sub-object (or multiple sub-objects) of the query. This is done by sending a query selector along with the predicate.
Changes
Marker
type parameter to determine which kind of object they should store insideCompoundPredicates
directlyCompoundPredicate
's generic now accepts the predicated type and not the predicate type itselfMigration Guide
Review notes
As with #4833, I tried documenting the system as a whole in
iroha_data_model::query::dsl
module documentation, so this might be a good place to start to understand the system.An example use of the API can be found in the
smart_contract_can_filter_queries
integration test.Each of the commit represents a logical step towards implementing the new query system. I ensured the tests would pass between those. This might make it easier to review the commits separately than in one big clump.
Checklist
CONTRIBUTING.md
.