database_operation_completed:從擁有邊界到可信查詢
將 database_operation_completed 視為持久的分析合約:所有者發出一個記錄的穀物,一個固定裝置證明欄位,並且經過審查的查詢回答所述問題。
- 1
結果成為最終結果
Database adapter or repository boundary emits only after the operation succeeds, rolls back, times out, or returns a classified error.
- 2
合約是有約束力的
9 required fields preserve the declared grain: One completed application-owned database operation.
- 3
夾具已驗證
檢查型別、UTC 時間、替代結果、冪等性以及每個假名或評論分類欄位。
- 4
問題得到解答
哪些操作指紋、版本和資料庫角色緩慢或失敗?
穀物
一項完成了應用程式擁有的資料庫操作。
業主
資料庫介面卡或儲存庫邊界
何時發出
操作成功後,回滾、超時或返回分類錯誤。
現場合約
具有明確隱私邊界的型別化欄位
在生產查詢依賴現有欄位名稱和型別後,保持現有欄位名稱和型別穩定。可選上下文應受到特定決策的限制、記錄和證明。
| 欄位 | 型別 | 必填 | 隱私 | 含義 |
|---|---|---|---|---|
| timestamp_utc | timestamp | yes | non-sensitive | 結果邊界處的 UTC 時間。 |
| event_id | string | yes | non-sensitive | 用於重複資料刪除的穩定唯一識別符號。 |
| release | string | yes | non-sensitive | 發出事件的應用程式或服務版本。 |
| account_id | string | yes | pseudonymous | 穩定的內部帳戶識別符號,絕不是電子郵件或姓名。 |
| operation_name | string | yes | non-sensitive | create_dashboard等應用執行穩定。 |
| query_fingerprint | string | yes | review | 審查標準化識別符號;絕不是原始 SQL 或繫結值。 |
| database_role | string | yes | non-sensitive | 有界角色,例如主角色、副本角色或分析角色。 |
| duration_ms | number | yes | non-sensitive | 應用程式觀察到的持續時間(以毫秒為單位)。 |
| status | string | yes | non-sensitive | 成功、超時、回滾或分類錯誤。 |
合成 JSON 事件
{
"timestamp_utc": "2026-07-29T09:21:34Z",
"event_id": "evt_database_01",
"account_id": "acct_8f31",
"release": "2026.07.3",
"operation_name": "list_recent_events",
"query_fingerprint": "select_recent_events_v2",
"database_role": "analytics",
"duration_ms": 241,
"status": "success"
}隱私審查
攝取前檢查識別符號
此範例使用合成識別符號。假名值仍然可以是個人資料,並且審查欄位可以公開業務或提供商上下文。應用您自己的同意、保留、存取、居住和刪除要求。
account_id: pseudonymousquery_fingerprint: review
驗證清單
在建置儀表板之前證明合約
- Send one known database_operation_completed fixture after the documented outcome boundary.
- Verify all 9 required fields arrive with the documented types.
- 重試相同的事件識別符號並確認所選的重複資料刪除行為。
- 當工作流程支援時,傳送受控失敗或替代結果。
- 在固定視窗上執行相關 SQL 並將結果與固定裝置進行協調。
常見錯誤
保持一行等於一個持久結果
- Emitting database_operation_completed before database adapter or repository boundary knows the final outcome.
- 在一張資料表中混合多種穀物,這使得計數和比率不明確。
- 用原始 URL、有效負載、提示或錯誤文字替換受控類別。
- 儲存查詢和儀表板依賴於它後就地更改欄位型別。
- 新增識別符號,無需記錄調查、存取和保留需求。
使用合約
查詢並操作事件
相關合約
在生產流量之前傳送夾具
建立免費的 API 金鑰、傳送合成事件並在連線即時工作流程之前檢查推斷資料表。