dejavu-cli 0.4.0

Stop showing coding agents the same command output twice.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Session lifecycle helpers.

use super::Db;
use crate::error::StoreError;
use rusqlite::params;

impl Db {
    /// Mark a session ended (idempotent — only sets `ended_at` once).
    pub fn end_session(&self, session_id: &str, ended_at: &str) -> Result<(), StoreError> {
        self.conn.execute(
            "UPDATE sessions SET ended_at = ?2 WHERE id = ?1 AND ended_at IS NULL",
            params![session_id, ended_at],
        )?;
        Ok(())
    }
}