Parent: #231 · Blocked by: #235
Scope
Add database schema and query functions for storing and retrieving transactions.
New Tables
transactions
| Column |
Type |
Notes |
| id |
TEXT PK |
event_id |
| project_id |
TEXT FK→projects |
|
| name |
TEXT |
"POST /api/feedback" |
| release |
TEXT |
nullable |
| environment |
TEXT |
nullable |
| duration_ms |
REAL |
timestamp - start_timestamp × 1000 |
| status |
TEXT |
"ok", "deadline_exceeded", etc |
| data |
TEXT |
full JSON payload |
| received_at |
TEXT |
ISO timestamp |
transaction_spans
| Column |
Type |
Notes |
| id |
TEXT PK |
|
| transaction_id |
TEXT FK→transactions |
|
| span_id |
TEXT |
|
| trace_id |
TEXT |
|
| parent_span_id |
TEXT |
nullable |
| op |
TEXT |
"db.sql.select", "http.client" |
| description |
TEXT |
nullable |
| start_offset_ms |
REAL |
relative to transaction start |
| duration_ms |
REAL |
|
| status |
TEXT |
nullable |
| data |
TEXT |
JSON |
Tasks
Effort: ~3 hours
Parent: #231 · Blocked by: #235
Scope
Add database schema and query functions for storing and retrieving transactions.
New Tables
transactionstransaction_spansTasks
003_transactions.sql003_transactions.sql(Postgres dialect)insert_transaction(project_id, transaction) -> Result<String>list_transactions(project_id, page, per_page, sort) -> Result<(Vec<TransactionRow>, i64)>get_transaction(id) -> Result<TransactionDetail>(with spans)get_slowest_transactions(project_id, limit) -> Result<Vec<TransactionRow>>Effort: ~3 hours