Fix nested selections getting empty array when all are removed#676
Fix nested selections getting empty array when all are removed#676
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds normalization in processRelationshipQueries to select all fields for nested relationships by default using [''] when no specific fields remain. Adjusts selection handling to issue [''] on empty nesting paths for SELECT queries. Minor indentation tweak in encodeSpatialData without functional change. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Database
participant QueryBuilder
Note over Client,Database: SELECT with nested relationship fields
Client->>Database: processRelationshipQueries(query, selections)
Database->>Database: Parse relation keys and nesting paths
alt Nesting path empty or no remaining fields
Note right of Database: Normalize to ['*'] to fetch all fields
Database->>QueryBuilder: selectRelation(relation, ['*'])
else Specific nested fields provided
Database->>QueryBuilder: selectRelation(relation, fields[])
end
QueryBuilder-->>Client: Finalized query metadata
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
Summary by CodeRabbit