docs(db): classify SQLite backend support

Signed-off-by: npub13n66s06epmqf2kc3v373ez8hj65cuzyvxzjf93vwpervxqn2u7jq2qd9je <8cf5a83f590ec0955b11647d1c88f796a98e088c30a492c58e0e46c3026ae7a4@buzz.block.builderlab.xyz>
This commit is contained in:
npub13n66s06epmqf2kc3v373ez8hj65cuzyvxzjf93vwpervxqn2u7jq2qd9je
2026-08-10 12:43:27 -04:00
committed by Brother Darryl
parent fe440a6afd
commit 90b889c846
2 changed files with 66 additions and 35 deletions
+33 -2
View File
@@ -2,8 +2,6 @@
Generated from `#[sqlite_backend(...)]` declarations in `crates/buzz-db/src/lib.rs`.
> ⚠️ **PROVISIONAL — classification in progress.** Most declarations are mechanical placeholders and this table is not yet valid S6 input.
Regenerate after changing declarations with:
```sh
@@ -12,4 +10,37 @@ cargo test -p buzz-db backend_inventory_is_current -- --nocapture
| Method | SQLite status | Reason |
| --- | --- | --- |
| `accept_push_lease_event` | unsupported | push delivery persistence is PostgreSQL-only |
| `active_push_match_leases` | unsupported | push delivery persistence is PostgreSQL-only |
| `archive_community_owned_by` | unsupported | community lifecycle management is PostgreSQL-only |
| `backfill_from_allowlist` | unsupported | relay membership maintenance is PostgreSQL-only |
| `begin_transaction` | unsupported | requires PostgreSQL operational infrastructure |
| `claim_due_push_match_batch` | unsupported | push delivery persistence is PostgreSQL-only |
| `claim_due_push_wakes` | unsupported | push delivery persistence is PostgreSQL-only |
| `complete_push_match_batch` | unsupported | push delivery persistence is PostgreSQL-only |
| `complete_push_wake` | unsupported | push delivery persistence is PostgreSQL-only |
| `create_community_with_owner` | unsupported | community lifecycle management is PostgreSQL-only |
| `disable_push_endpoint` | unsupported | push delivery persistence is PostgreSQL-only |
| `enqueue_push_wake` | unsupported | push delivery persistence is PostgreSQL-only |
| `enqueue_push_wakes` | unsupported | push delivery persistence is PostgreSQL-only |
| `fail_push_wake` | unsupported | push delivery persistence is PostgreSQL-only |
| `list_communities_owned_by` | unsupported | community lifecycle management is PostgreSQL-only |
| `lookup_community_by_host_for_management` | unsupported | community lifecycle management is PostgreSQL-only |
| `publish_nip43_membership_locked` | unsupported | relay membership maintenance is PostgreSQL-only |
| `reap_exhausted_push_matches` | unsupported | push delivery persistence is PostgreSQL-only |
| `retry_push_match_batch` | unsupported | push delivery persistence is PostgreSQL-only |
| `retry_push_wake` | unsupported | push delivery persistence is PostgreSQL-only |
| `revalidate_push_wake` | unsupported | push delivery persistence is PostgreSQL-only |
| `transfer_ownership` | unsupported | relay membership maintenance is PostgreSQL-only |
| `try_lock_usage_metrics` | unsupported | requires PostgreSQL operational infrastructure |
| `unarchive_community_owned_by` | unsupported | community lifecycle management is PostgreSQL-only |
| `usage_active_channel_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_active_user_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_channel_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_community_count` | unsupported | usage analytics is PostgreSQL-only |
| `usage_community_hosts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_git_repo_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_message_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_relay_member_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_user_counts` | unsupported | usage analytics is PostgreSQL-only |
| `usage_workflow_counts` | unsupported | usage analytics is PostgreSQL-only |
+33 -33
View File
@@ -1147,7 +1147,7 @@ impl Db {
/// detached from the shared pool so a stable leader neither returns a locked
/// session to other callers nor permanently consumes a pool slot. Dropping the
/// guard closes the connection and releases the session-scoped lock.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "requires PostgreSQL operational infrastructure")]
pub async fn try_lock_usage_metrics(
&self,
lock_key: i64,
@@ -1255,37 +1255,37 @@ impl Db {
}
/// Return per-community user counts split by human/agent.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_user_counts(&self) -> Result<Vec<usage::CommunityUserCounts>> {
usage::user_counts(self.pg_pool()?).await
}
/// Return per-community channel counts by type.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_channel_counts(&self) -> Result<Vec<usage::CommunityChannelCount>> {
usage::channel_counts(self.pg_pool()?).await
}
/// Return per-community kind=9 message counts.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_message_counts(&self) -> Result<Vec<usage::CommunityMessageCount>> {
usage::message_counts(self.pg_pool()?).await
}
/// Return per-community relay-member counts by role.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_relay_member_counts(&self) -> Result<Vec<usage::CommunityMemberCount>> {
usage::relay_member_counts(self.pg_pool()?).await
}
/// Return per-community workflow counts by status.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_workflow_counts(&self) -> Result<Vec<usage::CommunityWorkflowCount>> {
usage::workflow_counts(self.pg_pool()?).await
}
/// Return per-community git-repo counts.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_git_repo_counts(&self) -> Result<Vec<usage::CommunityGitRepoCount>> {
usage::git_repo_counts(self.pg_pool()?).await
}
@@ -1293,7 +1293,7 @@ impl Db {
/// Return per-community distinct active-user counts for a given SQL interval.
///
/// `interval_sql` must be a trusted literal such as `"1 day"` or `"7 days"`.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_active_user_counts(
&self,
interval_sql: &'static str,
@@ -1302,7 +1302,7 @@ impl Db {
}
/// Return per-community active-channel counts for a given SQL interval.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_active_channel_counts(
&self,
interval_sql: &'static str,
@@ -1311,7 +1311,7 @@ impl Db {
}
/// Return all community id → host mappings.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "usage analytics is PostgreSQL-only")]
pub async fn usage_community_hosts(&self) -> Result<Vec<usage::CommunityHost>> {
usage::community_hosts(self.pg_pool()?).await
}
@@ -1320,7 +1320,7 @@ impl Db {
///
/// Returns a `'static` transaction because `PgPool` is `Arc`-backed internally.
/// The transaction holds an owned pool handle, not a borrow.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "requires PostgreSQL operational infrastructure")]
pub async fn begin_transaction(&self) -> Result<sqlx::Transaction<'static, sqlx::Postgres>> {
self.pg_pool()?.begin().await.map_err(Into::into)
}
@@ -1377,7 +1377,7 @@ impl Db {
}
/// Returns a community by host regardless of lifecycle state. Operator-plane only.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "community lifecycle management is PostgreSQL-only")]
pub async fn lookup_community_by_host_for_management(
&self,
normalized_host: &str,
@@ -1399,7 +1399,7 @@ impl Db {
///
/// This is an operator-plane helper, not a tenant-scoped data-plane read:
/// callers must gate it on deployment-level operator auth before exposing it.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "community lifecycle management is PostgreSQL-only")]
pub async fn list_communities_owned_by(
&self,
owner_pubkey: &str,
@@ -1583,7 +1583,7 @@ impl Db {
/// Holds a per-owner advisory lock while enforcing the ownership limit.
/// Identical create retries return the original record; host collisions and
/// limit failures remain distinguishable to the operator API.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "community lifecycle management is PostgreSQL-only")]
pub async fn create_community_with_owner(
&self,
normalized_host: &str,
@@ -1669,7 +1669,7 @@ impl Db {
}
/// Idempotently archives a community when the asserted pubkey is its current owner.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "community lifecycle management is PostgreSQL-only")]
pub async fn archive_community_owned_by(
&self,
normalized_host: &str,
@@ -1703,7 +1703,7 @@ impl Db {
}
/// Idempotently restores a community when the asserted pubkey is its current owner.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "community lifecycle management is PostgreSQL-only")]
pub async fn unarchive_community_owned_by(
&self,
normalized_host: &str,
@@ -2237,7 +2237,7 @@ impl Db {
}
/// Exclusively claim a batch of due matcher jobs from one community.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn claim_due_push_match_batch(
&self,
limit: i64,
@@ -2247,7 +2247,7 @@ impl Db {
}
/// Load active endpoint-enabled leases eligible for push matching.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn active_push_match_leases(
&self,
community: CommunityId,
@@ -2256,7 +2256,7 @@ impl Db {
}
/// Complete matcher jobs from one claimed batch while the fence holds.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn complete_push_match_batch(
&self,
community: CommunityId,
@@ -2267,7 +2267,7 @@ impl Db {
}
/// Release fenced matcher claims from one batch for retry.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn retry_push_match_batch(
&self,
community: CommunityId,
@@ -2279,13 +2279,13 @@ impl Db {
}
/// Delete exhausted matcher jobs (periodic sweep, off the claim path).
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn reap_exhausted_push_matches(&self) -> Result<u64> {
push::reap_exhausted_matches(self.pg_pool()?).await
}
/// Idempotently enqueue a wake for a matched lease and event.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn enqueue_push_wake(
&self,
community: CommunityId,
@@ -2297,7 +2297,7 @@ impl Db {
}
/// Set-wise [`Self::enqueue_push_wake`]: one transaction per batch.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn enqueue_push_wakes(
&self,
community: CommunityId,
@@ -2307,7 +2307,7 @@ impl Db {
}
/// Exclusively claim due wake jobs for one community.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn claim_due_push_wakes(
&self,
community: CommunityId,
@@ -2318,7 +2318,7 @@ impl Db {
}
/// Revalidate a wake's claim, source event, and current lease before send.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn revalidate_push_wake(
&self,
community: CommunityId,
@@ -2329,7 +2329,7 @@ impl Db {
}
/// Mark a fenced wake claim delivered.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn complete_push_wake(
&self,
community: CommunityId,
@@ -2340,7 +2340,7 @@ impl Db {
}
/// Release a fenced wake claim for retry at the supplied time.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn retry_push_wake(
&self,
community: CommunityId,
@@ -2352,7 +2352,7 @@ impl Db {
}
/// Mark a fenced wake claim terminally failed.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn fail_push_wake(
&self,
community: CommunityId,
@@ -2363,7 +2363,7 @@ impl Db {
}
/// Disable an endpoint only if the specified lease generation is current.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn disable_push_endpoint(
&self,
community: CommunityId,
@@ -2383,7 +2383,7 @@ impl Db {
/// Atomically persist a validated kind:30350 event and its effective lease.
#[allow(clippy::too_many_arguments)]
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "push delivery persistence is PostgreSQL-only")]
pub async fn accept_push_lease_event(
&self,
community: CommunityId,
@@ -5774,7 +5774,7 @@ impl Db {
/// demoting the previous owner(s) to `member`. Verifies
/// `expected_owner_pubkey` matches the current owner inside the same
/// transaction to prevent stale-owner races.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "relay membership maintenance is PostgreSQL-only")]
pub async fn transfer_ownership(
&self,
community: CommunityId,
@@ -5794,7 +5794,7 @@ impl Db {
///
/// Idempotent — uses `ON CONFLICT DO NOTHING`. Returns the number of rows
/// inserted, or 0 if the `pubkey_allowlist` table doesn't exist.
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "relay membership maintenance is PostgreSQL-only")]
pub async fn backfill_from_allowlist(&self, community: CommunityId) -> Result<u64> {
relay_members::backfill_from_allowlist(self.pg_pool()?, community).await
}
@@ -6556,7 +6556,7 @@ impl Db {
/// prevents the stale-snapshot race where a concurrent publication reads
/// older state and overwrites a newer snapshot by arrival order.
///
#[sqlite_backend(implemented)]
#[sqlite_backend(unsupported = "relay membership maintenance is PostgreSQL-only")]
pub async fn publish_nip43_membership_locked(
&self,
community_id: CommunityId,