* @brief Loads the session header row into out, returning false on missing session. */
| 51 | * @brief Loads the session header row into out, returning false on missing session. |
| 52 | */ |
| 53 | static bool loadSessionHeader(QSqlDatabase& db, int sessionId, Sessions::ReportData& out) |
| 54 | { |
| 55 | QSqlQuery q(db); |
| 56 | q.prepare( |
| 57 | "SELECT s.project_title, s.started_at, s.ended_at, s.notes, " |
| 58 | " (SELECT COUNT(DISTINCT timestamp_ns) FROM readings WHERE session_id = s.session_id) " |
| 59 | "FROM sessions s WHERE s.session_id = ?"); |
| 60 | q.bindValue(0, sessionId); |
| 61 | if (!q.exec() || !q.next()) |
| 62 | return false; |
| 63 | |
| 64 | out.projectTitle = q.value(0).toString(); |
| 65 | out.startedAt = q.value(1).toString(); |
| 66 | out.endedAt = q.value(2).toString(); |
| 67 | out.notes = q.value(3).toString(); |
| 68 | out.frameCount = q.value(4).toLongLong(); |
| 69 | out.durationMs = computeDurationMs(out.startedAt, out.endedAt); |
| 70 | return true; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * @brief Reads the dataset column metadata into a default-initialized DatasetStats vector. |
no test coverage detected