Repository navigation
refactor(db): every query through typed effect-orm builders - #598
Merged
Merged
Maple Review Bot / Maple / review
succeeded
Nov 20, 2026 in 6m 14s
Confidence 10/10 · No issues found
🟢 Confidence 10/10 · safe to merge. The conversions preserve their WHERE clauses and filters; the message-search upsert's excludedAll() (does it rewrite id, the FTS content rowid?) is the one path no test pins.
no findings · tests covered · risk high
Replaces Hazel's hand-written SQL with typed effect-orm 0.11.0 builders across the sync runtime, objects, customers, auth and the bot gateway, and removes the Database service's raw query/execute/sql. The conversions I read keep the same filters and column values; no defect found.
- Visibility filters become
inSubquery/exists, keeping each principal's membership condition Databaselosesquery/execute/sql; tests seed throughSqlClient_object_meta,_changes,_outboxetc. become external query-only tables- sync-do outbox/inbox and
_changesrun throughSQLite.runSyncand fail withStoreError
What was checked
memberOf/channelAccess/conversationAccesskeep theirdeletedAt IS NULLand user filters (org-source.ts:28-64)searchAvailablestill counts threesqlite_mastertables;catchTag("DatabaseError")matches Hazel's tag (database.ts:40)inList/valuesOfstill bind onejson_eachparameter,isActiveequals the oldACTIVEfragment (customers/sql.ts:8-25)
f2385b8 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.
Loading