pub const CLOSE_SESSION_SQL: &str = " UPDATE sessions SET ended_at = ?1 WHERE session_id = ?2 AND ended_at IS NULL; ";
Mark a session as ended (clean transport close). Only updates if not already ended (idempotent).