fix: rowid column shift in get_message_with_rowid; add file logging and frontend error reporting
This commit is contained in:
@@ -148,11 +148,11 @@ pub fn get_message(db: &Connection, id: &str) -> Result<Option<Message>> {
|
||||
|
||||
pub fn get_message_with_rowid(db: &Connection, id: &str) -> Result<Option<(i64, Message)>> {
|
||||
let mut stmt = db.prepare(
|
||||
"SELECT rowid, id, conversation_id, role, content, tokens_in, tokens_out, elapsed_ms, first_token_ms, images_json, created_at
|
||||
"SELECT id, conversation_id, role, content, tokens_in, tokens_out, elapsed_ms, first_token_ms, images_json, created_at, rowid
|
||||
FROM messages WHERE id = ?1",
|
||||
)?;
|
||||
let mut rows = stmt.query_map(params![id], |row| {
|
||||
let rowid: i64 = row.get(0)?;
|
||||
let rowid: i64 = row.get(10)?;
|
||||
let msg = row_to_message(row)?;
|
||||
Ok((rowid, msg))
|
||||
})?;
|
||||
|
||||
Reference in New Issue
Block a user