-
Notifications
You must be signed in to change notification settings - Fork 166
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(torii-grpc): correct pagination logic for grpc query member #2256
Conversation
WalkthroughOhayo, sensei! The recent updates enhance the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
participant Database
Client->>Server: Request data with pagination
Server->>Database: Build SQL query with limit and offset
Database-->>Server: Return paginated results
Server-->>Client: Send paginated data and count query
Recent review detailsConfiguration used: .coderabbit.yaml Files selected for processing (4)
Files skipped from review as they are similar to previous changes (4)
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
crates/torii/grpc/src/server/subscriptions/event_message.rs (1)
199-206
: Ohayo sensei! Thebuild_sql_query
function definition does not include the additional parameters.The
build_sql_query
function call has been updated to include two additionalNone
parameters, but the function definition does not reflect these changes. Please update the function signature to handle the new parameters.
- File:
crates/torii/core/src/model.rs
- Function:
build_sql_query
Analysis chain
Ohayo sensei! Verify the new function call parameters.
The
build_sql_query
function call has been updated to include two additionalNone
parameters. Ensure that thebuild_sql_query
function handles these parameters correctly and that all necessary adjustments have been made.
Ohayo sensei! Let's verify the
build_sql_query
function parameters to ensure the newNone
parameters are correctly handled.
Ohayo sensei! Let's refine our search to ensure we capture the
build_sql_query
function definition correctly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new parameters in the `build_sql_query` function call. # Test: Search for the `build_sql_query` function definition. Expect: Parameters include `extra_param1` and `extra_param2`. rg --type rust 'fn build_sql_query'Length of output: 92
Script:
#!/bin/bash # Extract the `build_sql_query` function definition and its parameters. ast-grep --lang rust --pattern 'fn build_sql_query($_, $_, $_, $_, $_, $_, $_, $_, $_) { $$$ }'Length of output: 97
Script:
#!/bin/bash # Search for the `build_sql_query` function definition and include surrounding lines for context. rg --type rust 'fn build_sql_query' -A 10Length of output: 712
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
crates/torii/core/src/model.rs (2)
234-235
: Ohayo, sensei! Ensure that the new parameters are documented.The
limit
andoffset
parameters are added to the function signature. Ensure that these new parameters are well-documented to maintain clarity for future developers./// Optional limit for the number of rows to fetch. limit: Option<u32>, /// Optional offset for the rows to fetch. offset: Option<u32>,
236-236
: Ohayo, sensei! Ensure the return type is documented.The return type now includes a count query string. Ensure this change is reflected in the function documentation.
/// Returns a tuple containing the main query, a hashmap of formatted array queries, and a count query.
b1a826a
to
70f9fd7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2256 +/- ##
==========================================
- Coverage 70.29% 70.28% -0.01%
==========================================
Files 342 342
Lines 45094 45125 +31
==========================================
+ Hits 31698 31718 +20
- Misses 13396 13407 +11 ☔ View full report in Codecov by Sentry. |
Fixes pagination logic for query by member on GRPC
Summary by CodeRabbit
New Features
limit
andoffset
parameters.Improvements