(db *sql.DB, errorEventID string)
| 323 | } |
| 324 | |
| 325 | func loadBreadcrumbs(db *sql.DB, errorEventID string) []map[string]any { |
| 326 | rows, err := db.Query( |
| 327 | `SELECT bc_type, category, level, message, bc_timestamp, data |
| 328 | FROM sentry_breadcrumbs WHERE error_event_id = ? ORDER BY bc_timestamp`, errorEventID, |
| 329 | ) |
| 330 | if err != nil { |
| 331 | return []map[string]any{} |
| 332 | } |
| 333 | defer rows.Close() |
| 334 | |
| 335 | var result []map[string]any |
| 336 | for rows.Next() { |
| 337 | var ( |
| 338 | bcType, category, level, message sql.NullString |
| 339 | bcTimestamp sql.NullString |
| 340 | dataStr sql.NullString |
| 341 | ) |
| 342 | if err := rows.Scan(&bcType, &category, &level, &message, &bcTimestamp, &dataStr); err != nil { |
| 343 | continue |
| 344 | } |
| 345 | |
| 346 | var data any |
| 347 | if dataStr.Valid { |
| 348 | json.Unmarshal([]byte(dataStr.String), &data) |
| 349 | } |
| 350 | |
| 351 | result = append(result, map[string]any{ |
| 352 | "type": scanNullString(bcType), |
| 353 | "category": scanNullString(category), |
| 354 | "level": scanNullString(level), |
| 355 | "message": scanNullString(message), |
| 356 | "timestamp": scanNullString(bcTimestamp), |
| 357 | "data": data, |
| 358 | }) |
| 359 | } |
| 360 | |
| 361 | if result == nil { |
| 362 | result = []map[string]any{} |
| 363 | } |
| 364 | return result |
| 365 | } |
| 366 | |
| 367 | func loadTraceSummary(db *sql.DB, traceID string) map[string]any { |
| 368 | // Load transaction for this trace. |
no test coverage detected