Repository navigation
Clarify DatabaseServiceAdapter is temporary solution - #150
Merged
Merged
Conversation
Adds native queryNodes functionality to Rust backend, eliminating the need for the temporary DatabaseServiceAdapter wrapper class in the frontend. Backend changes: - Add NodeQuery struct with builder methods for simple queries (id, mentionedBy, contentContains, nodeType, limit) - Implement query_nodes_simple method in NodeService with priority-based query selection (id > mentionedBy > contentContains > nodeType) - Add query_nodes_simple Tauri command and register it - Export NodeQuery from nodespace_core Frontend changes: - Add queryNodes method to TauriNodeService with camelCase parameters - Remove DatabaseServiceAdapter class entirely - Update NodeReferenceService to use TauriNodeService directly - Replace upsertNode with direct create/update logic - Update all queryNodes calls to use camelCase (mentionedBy, contentContains, nodeType) Test changes: - Update MockTauriNodeService to match real TauriNodeService signature with camelCase parameters Technical implementation: - Uses SQLite JSON_EACH to efficiently query mentions arrays stored in properties.mentions - Handles dynamic parameters with separate code paths for different query combinations to satisfy libsql's type requirements - Maintains backward compatibility with existing query patterns Closes #147 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…rvice Removed outdated reference to MockDatabaseService in header comment and updated to accurately reflect the use of TauriNodeService with native backend queries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
**Changes:** **Backend Architecture (Rust):** - Added `mentions` and `mentioned_by` fields to Node struct - Implemented bidirectional mention system using existing node_mentions table - Added methods: add_mention(), remove_mention(), get_mentions(), get_mentioned_by() - Updated get_node() to populate mentions from database - Refactored query_nodes_simple() to use node_mentions table instead of JSON_EACH - Added populate_mentions() helper method for efficient mention queries - Added database index for JSON mentions (temporary performance fix) **Code Quality:** - Refactored duplicate content_contains query code - Added 7 comprehensive unit tests for mentions functionality - All 88 tests passing - Fixed documentation example to use no_run annotation **Performance Improvements:** - Replaced inefficient JSON_EACH queries with direct table joins - Index on mentions improves query performance This addresses the architectural concern raised in PR review about mentions being stored in JSON properties. The backend now uses proper relational structure with the node_mentions table while maintaining backward compatibility. Frontend integration will be handled separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
This was referenced Oct 5, 2025
Collaborator
Author
Code Review Fixes Implemented✅ Must-Fix Items (All Completed)
📋 Nice-to-Have Issues CreatedCreated 3 GitHub issues for future enhancements:
🧪 Test ResultsAll 88 unit tests passing: 📝 SummaryThis addresses the critical architectural concern about mentions being stored in JSON properties. The backend now uses proper relational structure with full bidirectional support. Frontend integration will happen in a future PR as originally planned. Ready for re-review! 🚀 |
Added mentions and mentioned_by field initialization in create_node command to match updated Node struct. Both fields start empty and are populated by the database layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Documents the N+1 query pattern in populate_mentions() calls within query_nodes_simple(). This is acceptable for current scale (<50 nodes per query) but should be optimized with batch queries when usage grows. Tracked in issue #163. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 4, 2026
* Implement queryNodes in Rust backend and remove DatabaseServiceAdapter Adds native queryNodes functionality to Rust backend, eliminating the need for the temporary DatabaseServiceAdapter wrapper class in the frontend. Backend changes: - Add NodeQuery struct with builder methods for simple queries (id, mentionedBy, contentContains, nodeType, limit) - Implement query_nodes_simple method in NodeService with priority-based query selection (id > mentionedBy > contentContains > nodeType) - Add query_nodes_simple Tauri command and register it - Export NodeQuery from nodespace_core Frontend changes: - Add queryNodes method to TauriNodeService with camelCase parameters - Remove DatabaseServiceAdapter class entirely - Update NodeReferenceService to use TauriNodeService directly - Replace upsertNode with direct create/update logic - Update all queryNodes calls to use camelCase (mentionedBy, contentContains, nodeType) Test changes: - Update MockTauriNodeService to match real TauriNodeService signature with camelCase parameters Technical implementation: - Uses SQLite JSON_EACH to efficiently query mentions arrays stored in properties.mentions - Handles dynamic parameters with separate code paths for different query combinations to satisfy libsql's type requirements - Maintains backward compatibility with existing query patterns Closes #147 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix: Update NodeReferenceService documentation to reflect TauriNodeService Removed outdated reference to MockDatabaseService in header comment and updated to accurately reflect the use of TauriNodeService with native backend queries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement proper mentions architecture using node_mentions table **Changes:** **Backend Architecture (Rust):** - Added `mentions` and `mentioned_by` fields to Node struct - Implemented bidirectional mention system using existing node_mentions table - Added methods: add_mention(), remove_mention(), get_mentions(), get_mentioned_by() - Updated get_node() to populate mentions from database - Refactored query_nodes_simple() to use node_mentions table instead of JSON_EACH - Added populate_mentions() helper method for efficient mention queries - Added database index for JSON mentions (temporary performance fix) **Code Quality:** - Refactored duplicate content_contains query code - Added 7 comprehensive unit tests for mentions functionality - All 88 tests passing - Fixed documentation example to use no_run annotation **Performance Improvements:** - Replaced inefficient JSON_EACH queries with direct table joins - Index on mentions improves query performance This addresses the architectural concern raised in PR review about mentions being stored in JSON properties. The backend now uses proper relational structure with the node_mentions table while maintaining backward compatibility. Frontend integration will be handled separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix Tauri create_node to include new mentions fields Added mentions and mentioned_by field initialization in create_node command to match updated Node struct. Both fields start empty and are populated by the database layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add TODO comments for N+1 query optimization Documents the N+1 query pattern in populate_mentions() calls within query_nodes_simple(). This is acceptable for current scale (<50 nodes per query) but should be optimized with batch queries when usage grows. Tracked in issue #163. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 5, 2026
* Implement queryNodes in Rust backend and remove DatabaseServiceAdapter Adds native queryNodes functionality to Rust backend, eliminating the need for the temporary DatabaseServiceAdapter wrapper class in the frontend. Backend changes: - Add NodeQuery struct with builder methods for simple queries (id, mentionedBy, contentContains, nodeType, limit) - Implement query_nodes_simple method in NodeService with priority-based query selection (id > mentionedBy > contentContains > nodeType) - Add query_nodes_simple Tauri command and register it - Export NodeQuery from nodespace_core Frontend changes: - Add queryNodes method to TauriNodeService with camelCase parameters - Remove DatabaseServiceAdapter class entirely - Update NodeReferenceService to use TauriNodeService directly - Replace upsertNode with direct create/update logic - Update all queryNodes calls to use camelCase (mentionedBy, contentContains, nodeType) Test changes: - Update MockTauriNodeService to match real TauriNodeService signature with camelCase parameters Technical implementation: - Uses SQLite JSON_EACH to efficiently query mentions arrays stored in properties.mentions - Handles dynamic parameters with separate code paths for different query combinations to satisfy libsql's type requirements - Maintains backward compatibility with existing query patterns Closes #147 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix: Update NodeReferenceService documentation to reflect TauriNodeService Removed outdated reference to MockDatabaseService in header comment and updated to accurately reflect the use of TauriNodeService with native backend queries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement proper mentions architecture using node_mentions table **Changes:** **Backend Architecture (Rust):** - Added `mentions` and `mentioned_by` fields to Node struct - Implemented bidirectional mention system using existing node_mentions table - Added methods: add_mention(), remove_mention(), get_mentions(), get_mentioned_by() - Updated get_node() to populate mentions from database - Refactored query_nodes_simple() to use node_mentions table instead of JSON_EACH - Added populate_mentions() helper method for efficient mention queries - Added database index for JSON mentions (temporary performance fix) **Code Quality:** - Refactored duplicate content_contains query code - Added 7 comprehensive unit tests for mentions functionality - All 88 tests passing - Fixed documentation example to use no_run annotation **Performance Improvements:** - Replaced inefficient JSON_EACH queries with direct table joins - Index on mentions improves query performance This addresses the architectural concern raised in PR review about mentions being stored in JSON properties. The backend now uses proper relational structure with the node_mentions table while maintaining backward compatibility. Frontend integration will be handled separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix Tauri create_node to include new mentions fields Added mentions and mentioned_by field initialization in create_node command to match updated Node struct. Both fields start empty and are populated by the database layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add TODO comments for N+1 query optimization Documents the N+1 query pattern in populate_mentions() calls within query_nodes_simple(). This is acceptable for current scale (<50 nodes per query) but should be optimized with batch queries when usage grows. Tracked in issue #163. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
malibio
added a commit
that referenced
this pull request
Feb 26, 2026
* Implement queryNodes in Rust backend and remove DatabaseServiceAdapter Adds native queryNodes functionality to Rust backend, eliminating the need for the temporary DatabaseServiceAdapter wrapper class in the frontend. Backend changes: - Add NodeQuery struct with builder methods for simple queries (id, mentionedBy, contentContains, nodeType, limit) - Implement query_nodes_simple method in NodeService with priority-based query selection (id > mentionedBy > contentContains > nodeType) - Add query_nodes_simple Tauri command and register it - Export NodeQuery from nodespace_core Frontend changes: - Add queryNodes method to TauriNodeService with camelCase parameters - Remove DatabaseServiceAdapter class entirely - Update NodeReferenceService to use TauriNodeService directly - Replace upsertNode with direct create/update logic - Update all queryNodes calls to use camelCase (mentionedBy, contentContains, nodeType) Test changes: - Update MockTauriNodeService to match real TauriNodeService signature with camelCase parameters Technical implementation: - Uses SQLite JSON_EACH to efficiently query mentions arrays stored in properties.mentions - Handles dynamic parameters with separate code paths for different query combinations to satisfy libsql's type requirements - Maintains backward compatibility with existing query patterns Closes #147 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix: Update NodeReferenceService documentation to reflect TauriNodeService Removed outdated reference to MockDatabaseService in header comment and updated to accurately reflect the use of TauriNodeService with native backend queries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Implement proper mentions architecture using node_mentions table **Changes:** **Backend Architecture (Rust):** - Added `mentions` and `mentioned_by` fields to Node struct - Implemented bidirectional mention system using existing node_mentions table - Added methods: add_mention(), remove_mention(), get_mentions(), get_mentioned_by() - Updated get_node() to populate mentions from database - Refactored query_nodes_simple() to use node_mentions table instead of JSON_EACH - Added populate_mentions() helper method for efficient mention queries - Added database index for JSON mentions (temporary performance fix) **Code Quality:** - Refactored duplicate content_contains query code - Added 7 comprehensive unit tests for mentions functionality - All 88 tests passing - Fixed documentation example to use no_run annotation **Performance Improvements:** - Replaced inefficient JSON_EACH queries with direct table joins - Index on mentions improves query performance This addresses the architectural concern raised in PR review about mentions being stored in JSON properties. The backend now uses proper relational structure with the node_mentions table while maintaining backward compatibility. Frontend integration will be handled separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix Tauri create_node to include new mentions fields Added mentions and mentioned_by field initialization in create_node command to match updated Node struct. Both fields start empty and are populated by the database layer. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Add TODO comments for N+1 query optimization Documents the N+1 query pattern in populate_mentions() calls within query_nodes_simple(). This is acceptable for current scale (<50 nodes per query) but should be optimized with batch queries when usage grows. Tracked in issue #163. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #147