Skip to content
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

refactor: query filters #4833

Merged
merged 36 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
92aa506
refactor(queries): remove the PredicateSymbol trait
DCNick3 May 29, 2024
a2662da
refactor(queries): make the predicates always accept input by reference
DCNick3 May 29, 2024
fd893c3
feat(queries): add a type-checked predicate construction dsl
DCNick3 Jun 7, 2024
f19eb1b
feat(queries)!: add a new set of query types to support the new dsl, …
DCNick3 Jul 1, 2024
859e151
feat(queries)!: add the rest of the queries to IterableQueryBox and S…
DCNick3 Jul 1, 2024
52aa5a5
feat(queries)!: implement the execution logic for the new queries
DCNick3 Jul 3, 2024
5025ba5
feat(queries)!: implement the new query execution in wasm, add an err…
DCNick3 Jul 5, 2024
6ab898b
feat(queries)!: validate the new queries in the executor
DCNick3 Jul 8, 2024
8ed540d
feat(queries)!: allow a simplistic type-erased query execution in cli…
DCNick3 Jul 8, 2024
94714f9
feat(queries)!: remove the old query system entirely, fix the schema …
DCNick3 Jul 9, 2024
fcec7d2
feat(queries): add documentation for the new query system
DCNick3 Jul 16, 2024
4ed5934
refactor(queries): remove stray comments
DCNick3 Jul 16, 2024
0605439
feat(queries): add `or` and `not` methods to the `CompoundPredicate`,…
DCNick3 Jul 16, 2024
915721a
fix(queries): clippy warnings introduced in queries refactor
DCNick3 Jul 18, 2024
0b335ea
refactor(queries): renames to make iterable query the default case
DCNick3 Jul 18, 2024
302603c
fix(queries): UI tests after the query refactor
DCNick3 Jul 19, 2024
d595543
fixup! feat(queries)!: add a new set of query types to support the ne…
DCNick3 Jul 22, 2024
300e6af
fix(queries): update pytests to use the new query filters
DCNick3 Jul 22, 2024
eae5415
refactor(queries)!: remove `All` suffix from applicable iterable queries
DCNick3 Jul 23, 2024
b19a4b9
refactor(queries)!: rename `FindXXXKeyValueByIdAndKey` queries to `Fi…
DCNick3 Jul 23, 2024
145786d
refactor(queries)!: rename `with_filter` -> `filter_with` and `with_r…
DCNick3 Jul 23, 2024
01e0c82
feat(queries): add a test for signed query decoding validation
DCNick3 Jul 24, 2024
ff75a0e
feat(queries): complete the `test_operator_overloading` test, clean u…
DCNick3 Jul 24, 2024
1d888aa
refactor(queries)!: apply a couple of renames
DCNick3 Jul 26, 2024
f42a246
refactor(queries): remove extra generic parameter
DCNick3 Jul 26, 2024
81c7a42
refactor(queries): remove commented code
DCNick3 Jul 26, 2024
b3aa11b
refactor(queries): remove outdated comment about MetadataPredicateBox
DCNick3 Jul 26, 2024
1e15f57
refactor(queries)!: finish the rename remove "All" from the names of …
DCNick3 Jul 26, 2024
2ee55eb
refactor(queries)!: move convenience methods on the builder to an ext…
DCNick3 Jul 30, 2024
0aca342
refactor(queries)!: remove Iterable prefix from query types as it's g…
DCNick3 Aug 5, 2024
5b9695b
refactor(queries)!: apply some more renames
DCNick3 Aug 5, 2024
2d98946
refactor(queries)!: make `ClientQueryRequestHead`'s fields and `Clien…
DCNick3 Aug 5, 2024
2ffbc83
fix(queries): put the executor in the right place (whoops)
DCNick3 Aug 5, 2024
7384789
fix(queries): fix more clippy warns
DCNick3 Aug 5, 2024
73b5acc
refactor(queries): construct `FindError` instead of returning a strin…
DCNick3 Aug 5, 2024
6ff772d
refactor(queries)!: remove QueryIterator::remaining_in_current_batch …
DCNick3 Aug 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions client/benches/torii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use iroha::{
};
use iroha_genesis::GenesisBuilder;
use iroha_primitives::unique_vec;
use iroha_version::Encode;
use irohad::samples::get_config;
use test_network::{
construct_executor, get_chain_id, get_key_pair, Peer as TestPeer, PeerBuilder, TestRuntime,
Expand Down Expand Up @@ -82,15 +81,17 @@ fn query_requests(criterion: &mut Criterion) {
])
.expect("Failed to prepare state");

let request = asset::by_account_id(account_id);
let query = iroha
.query(asset::all())
.filter_with(|asset| asset.id.account.eq(account_id));
thread::sleep(std::time::Duration::from_millis(1500));
let mut success_count = 0;
let mut failures_count = 0;
let _dropable = group.throughput(Throughput::Bytes(request.encode().len() as u64));
// reporting elements and not bytes here because the new query builder doesn't easily expose the box type used in transport
let _dropable = group.throughput(Throughput::Elements(1));
let _dropable2 = group.bench_function("query", |b| {
b.iter(|| {
let iter: Result<Vec<_>, _> =
iroha.request(request.clone()).and_then(Iterator::collect);
let iter = query.clone().execute_all();

match iter {
Ok(assets) => {
Expand Down
Loading
Loading