hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
444 stars 277 forks source link

feat(queries)!: Query projections #5242

Open DCNick3 opened 1 week ago

DCNick3 commented 1 week ago

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

Migration 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