systemprompt_logging/models/log_row.rs
1//! Test-only `LogRow` shape exposed for unit tests that exercise the row→entry
2//! mapping shape. Production read paths use local non-Option `LogRow` structs
3//! defined in `repository/operations/queries.rs` and
4//! `trace/log_lookup_queries.rs`; they do not go through this type. The struct
5//! is preserved because removing it would force a cross-cutting rewrite of the
6//! logging test surface; it must not be used in production code.
7//!
8//! Copyright (c) systemprompt.io — Business Source License 1.1.
9//! See <https://systemprompt.io> for licensing details.
10
11use chrono::{DateTime, Utc};
12use sqlx::FromRow;
13use systemprompt_identifiers::{ClientId, ContextId, LogId, SessionId, TaskId, TraceId, UserId};
14
15#[derive(Debug, FromRow)]
16pub struct LogRow {
17 pub id: LogId,
18 pub timestamp: DateTime<Utc>,
19 pub level: String,
20 pub module: String,
21 pub message: String,
22 pub metadata: Option<String>,
23 pub user_id: UserId,
24 pub session_id: SessionId,
25 pub task_id: Option<TaskId>,
26 pub trace_id: TraceId,
27 pub context_id: Option<ContextId>,
28 pub client_id: Option<ClientId>,
29}