You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 41529f2
Browse filesBrowse the repository at this point in the historyBrowse files
buzz-db: move the search pool and Postgres search SQL behind buzz-db
buzz-search built its own pool and ran its own SQL: the FTS and
profile-name queries, the abandoned-search cancel, and the outbox
gauge read. The indexer reached the writer pool through Db::pool().
- The FTS query module and its cancel logic move to buzz_db::search,
unchanged except for the error type. A SearchStore owns the search
pool. SearchStore::connect builds it the way the relay used to.
- SearchService takes a SearchStore instead of a PgPool. buzz-search
re-exports the query types, so callers keep their imports.
- The indexer and the outbox gauges use Db::search_outbox_store().
The gauge read takes a Db, so the relay sampler no longer needs the
writer pool.
- SearchError::Db holds a DbError instead of sqlx::Error.
buzz-search no longer uses sqlx in production, so it moves to its
dev-dependencies. The search pool construction test moves from the
relay to buzz-db.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Luke Tornquist <tornquist@squareup.com>
buzz-test-client (integration test harness + manual CLI)
146
146
```
147
147
148
-
**Key architectural principle:** The relay is the single source of truth. `buzz-relay` orchestrates all subsystems by calling them directly — it imports `buzz-db`, `buzz-auth`, `buzz-pubsub`, `buzz-search`, `buzz-audit`, and `buzz-workflow`. However, those subsystems are isolated from each other: `buzz-workflow` never calls `buzz-pubsub`, `buzz-search` never calls `buzz-db`, etc. The one sanctioned exception is `buzz-audit`, which stores its chain through `buzz_db::AuditLog`. `buzz-audit` computes and checks the hashes; `AuditLog` owns the audit pool and the chain's appends and reads. Cross-subsystem coordination happens only through the relay. In multi-community mode, the relay also owns propagation of `TenantContext`; service crates should receive community-scoped inputs rather than independently deriving tenancy from client-controlled event tags.
148
+
**Key architectural principle:** The relay is the single source of truth. `buzz-relay` orchestrates all subsystems by calling them directly — it imports `buzz-db`, `buzz-auth`, `buzz-pubsub`, `buzz-search`, `buzz-audit`, and `buzz-workflow`. However, those subsystems are isolated from each other: `buzz-workflow` never calls `buzz-pubsub`, etc. The one sanctioned exception is `buzz-audit`, which stores its chain through `buzz_db::AuditLog`. `buzz-audit` computes and checks the hashes; `AuditLog` owns the audit pool and the chain's appends and reads. Every crate reaches Postgres only through `buzz-db`. Cross-subsystem coordination happens only through the relay. In multi-community mode, the relay also owns propagation of `TenantContext`; service crates should receive community-scoped inputs rather than independently deriving tenancy from client-controlled event tags.
149
149
150
150
---
151
151
@@ -585,7 +585,8 @@ kind 30180 (custom emoji entries) until an operator runs the updated maintenance
585
585
script, which must happen before the emoji migration rollout.
586
586
587
587
**Key behaviors:**
588
-
-`SearchService::new(pool)` wraps a `PgPool`; `search(&SearchQuery)` runs a
588
+
-`SearchService::new(store)` wraps a `buzz_db::SearchStore`, which owns the
589
+
search pool and the FTS SQL (`buzz_db::search`); `search(&SearchQuery)` runs a
589
590
parameterized FTS query against the `events.search_tsv` GIN index and returns
0 commit comments