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

feat(torii-grpc): support multiple entity models in queries & complex keys clause for subscriptions + queries #2095

Merged
merged 28 commits into from
Jun 27, 2024

Conversation

Larkooo
Copy link
Collaborator

@Larkooo Larkooo commented Jun 21, 2024

Description

adds support for KeysClause on subscriptions, to match all entities with a certain key pattern. This will allow for more control over the subscriptions. Like subscribing for entities with a specific game_id or a pattern of specific keys.

Also refactor the entities queries to reuse them for subscriptions and oher small changes. The new entities queries use the complex keys clause that can take in a key pattern with a pattern matching type for complex keys queries.

This also makes the queries support entities of multiple models, like an entity with Game model and entities with PlayerGame + PlayerPosition models.

Related issue

#1983

@Larkooo Larkooo marked this pull request as ready for review June 21, 2024 17:34
Copy link

codecov bot commented Jun 21, 2024

Codecov Report

Attention: Patch coverage is 16.51163% with 359 lines in your changes missing coverage. Please review.

Project coverage is 68.34%. Comparing base (b04c0d7) to head (48c9c2e).
Report is 1 commits behind head on main.

Files Patch % Lines
crates/torii/grpc/src/server/mod.rs 36.74% 105 Missing ⚠️
...ates/torii/grpc/src/server/subscriptions/entity.rs 0.00% 76 Missing ⚠️
...rii/grpc/src/server/subscriptions/event_message.rs 0.00% 65 Missing ⚠️
crates/torii/grpc/src/types/mod.rs 1.96% 50 Missing ⚠️
...rates/torii/grpc/src/server/subscriptions/event.rs 0.00% 35 Missing ⚠️
crates/torii/client/src/client/mod.rs 0.00% 14 Missing ⚠️
crates/torii/grpc/src/client.rs 0.00% 9 Missing ⚠️
crates/torii/core/src/sql.rs 0.00% 3 Missing ⚠️
crates/torii/client/src/client/subscription.rs 83.33% 1 Missing ⚠️
.../torii/grpc/src/server/subscriptions/model_diff.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2095      +/-   ##
==========================================
- Coverage   68.50%   68.34%   -0.17%     
==========================================
  Files         331      331              
  Lines       41337    41443     +106     
==========================================
+ Hits        28319    28323       +4     
- Misses      13018    13120     +102     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Larkooo Larkooo force-pushed the keys-subscription branch from 73c46fa to 7102292 Compare June 21, 2024 20:42
@glihm glihm linked an issue Jun 21, 2024 that may be closed by this pull request
@glihm glihm changed the title feat(torii-grpc): start working on keys entity subscription feat(torii-grpc): add keys clause for entity subscription Jun 25, 2024
@Larkooo Larkooo force-pushed the keys-subscription branch from b5b4a0f to c44b1d5 Compare June 26, 2024 18:13
@Larkooo Larkooo changed the title feat(torii-grpc): add keys clause for entity subscription feat(torii-grpc): support multiple entity models in queries & complex keys clause for subscriptions + queries Jun 27, 2024
Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@glihm glihm merged commit ca42629 into dojoengine:main Jun 27, 2024
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscription by member clause
2 participants