feat(rook): build registry services for account, pool, route, and settings#608
Conversation
…tings - Add SqliteAccountService, SqlitePoolService, SqliteRouteService wired to the correct db layer methods (insert_*, get_*, delete_*); update implemented as delete + insert since the db layer has no update_* ops - Add SettingsService trait with InMemorySettingsService and SqliteSettingsService backed by a single-row upsert pattern - Add db/settings.rs with load_settings / save_settings helpers - Add migration 0002_settings.sql creating the settings table - Add RookRegistry using concrete types (not dyn Trait) to stay compatible with RPITIT async traits; exposes typed accessors for all four services - Expand domain/mod.rs with RookSettings and a sensible Default Close #584
Deploying corvus with
|
| Latest commit: |
9bc818e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://f5c2db64.corvus-42x.pages.dev |
| Branch Preview URL: | https://feat-rook-584-registry-servi.corvus-42x.pages.dev |
✅ Contributor ReportUser: @yacosta738
Contributor Report evaluates based on public GitHub activity. Analysis period: 2025-04-20 to 2026-04-20 |
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 36 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Implements #584 — registry services for the Rook local-first provider gateway.
What changed
SqliteAccountService— CRUD forProviderAccountwired to the correct db layer methods (insert_account,get_account,delete_account). Update = delete + insert (db layer has noupdate_*ops).SqlitePoolService— CRUD forProviderPoolincluding member management (add_pool_member,remove_pool_member). Pool delete and update via rawsqlx::querysince the db layer has nodelete_pool.SqliteRouteService— CRUD forModelRoutewith model-based lookup (find_route_by_model). Update = delete + insert.SettingsServicetrait — async trait withInMemorySettingsServiceandSqliteSettingsService; backed by a single-row upsert pattern.db/settings.rs—load_settings/save_settingshelpers.migrations/0002_settings.sql—settingstable (single-row enforced viaWHERE id = 1).RookRegistry— uses concrete types (notdyn Trait) to stay compatible with RPITIT async traits (Rust 1.75+, noasync_trait). Exposes typed accessors for all four services.domain/mod.rs— addedRookSettingsstruct with a sensibleDefault.Design decisions
async_trait— RPITIT traits (fn foo(&self) -> impl Future<Output = T> + Send) are not dyn-compatible, soRookRegistryholds concreteSqlite*Servicetypes. This avoids vtable overhead and theasync_traitmacro entirely.update_*methods; this keeps the service layer honest about what the db actually supports.Test results
83/84 tests pass. The 1 failure (
db::account::tests::vendor_other_with_quotes_round_trips) is a pre-existing bug in quote-escaping forProviderVendor::Other— unrelated to this PR.Close #584