Add ObservableQuery to reduce GRDBQuery dependency#1689
Add ObservableQuery to reduce GRDBQuery dependency#1689
Conversation
Introduce custom query observation system: - Add ObservableQuery generic wrapper for reactive database queries - Add DatabaseQueryable protocol (replaces ValueObservationQueryable) - Add DatabaseAccess environment key for database injection - Add QueryBindingModifier with .bindQuery() view modifier Migrate TransactionsRequest and related ViewModels to new system: - TransactionsFilterViewModel, TransactionsViewModel - AssetSceneViewModel, PerpetualSceneViewModel
Summary of ChangesHello @DRadmir, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refactors the application's data observation layer by introducing a custom, more integrated system for reactive database queries. The primary goal is to reduce reliance on the external Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a well-designed custom query observation system, effectively reducing the dependency on GRDBQuery. The new ObservableQuery wrapper and DatabaseQueryable protocol provide a clean, reactive way to handle database queries. The migration of existing view models and views to this new system is thorough and improves the overall architecture. I have one suggestion for improving consistency in the TransactionsFilterViewModel.
Features/Transactions/Sources/ViewModels/TransactionsFilterViewModel.swift
Outdated
Show resolved
Hide resolved
e7e7e55 to
39f7163
Compare
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove bindQuery modifier in favor of unified onChangeBindQuery - Remove AssetData.empty and ChainAssetData.empty, use with(asset:) pattern - Inline all ObservableQuery initializations to single lines - Move transactionsQuery and isPresentingToastMessage to MainTabViewModel - Fix duplicate Store imports in test files - Simplify test mocks by reusing model instances
…e-query # Conflicts: # Features/Perpetuals/Sources/ViewModels/PerpetualSceneViewModel.swift # Features/Swap/Sources/Scenes/SwapScene.swift # Features/Swap/Tests/SwapTests/SwapSceneViewModelTests.swift # Features/WalletTab/Sources/ViewModels/WalletSceneViewModel.swift # Packages/Store/Sources/Requests/TotalValueRequest.swift
Introduce custom query observation system:
Migrate TransactionsRequest and related ViewModels to new system:
TransactionsFilterViewModel, TransactionsViewModel
AssetSceneViewModel, PerpetualSceneViewModel
Test