feat(queries)!: Query projections#5242
Merged
mversic merged 9 commits intohyperledger-iroha:mainfrom Nov 27, 2024
Merged
Conversation
56ed397 to
3965e8c
Compare
99801df to
241c3ce
Compare
s8sato
reviewed
Nov 20, 2024
Contributor
s8sato
left a comment
There was a problem hiding this comment.
Insightful and well-planned work. Very little to comment on
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⭐️ <dcnick3@users.noreply.github.com>
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⭐️ <dcnick3@users.noreply.github.com>
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⭐️ <dcnick3@users.noreply.github.com>
…he selector in core Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
This is more natural for humans than the columnar format iroha uses in transit Signed-off-by: ⭐️NINIKA⭐️ <dcnick3@users.noreply.github.com>
76122e0 to
81a4dec
Compare
mversic
approved these changes
Nov 26, 2024
Contributor
mversic
left a comment
There was a problem hiding this comment.
Incredibly powerful stuff. Great API design.
s8sato
approved these changes
Nov 26, 2024
8 tasks
This file contains hidden or 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
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.
Context
Closes #5063. Helps to continue #4933.
Some of the singular queries are there to select a small sub-object (like
FindXxxMetadataqueries). 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
Markertype parameter to determine which kind of object they should store insideCompoundPredicatesdirectlyCompoundPredicate'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::dslmodule 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_queriesintegration 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.