Fix: Date-Panic in Wissensbasis (chrono::NaiveDateTime)
- mysql_async mit chrono-Feature für NaiveDateTime-Support - 7 SELECTs in knowledge.rs von String auf NaiveDateTime umgestellt - Timestamps werden jetzt korrekt formatiert statt Panic Getestet: - Wissens-Suche funktioniert ohne Crash - Handlanger-Modus Chat-Antwort erscheint - VSCodium-Extension Verbindung OK Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
0c095a4d49
commit
a203589eda
4 changed files with 32 additions and 15 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -30,3 +30,4 @@ package-lock.json
|
|||
.claude/scheduled_tasks.lock
|
||||
vscode-extension/out/
|
||||
vscode-extension/node_modules/
|
||||
*.vsix
|
||||
|
|
|
|||
1
src-tauri/Cargo.lock
generated
1
src-tauri/Cargo.lock
generated
|
|
@ -2521,6 +2521,7 @@ dependencies = [
|
|||
"byteorder",
|
||||
"bytes",
|
||||
"cc",
|
||||
"chrono",
|
||||
"cmake",
|
||||
"crc32fast",
|
||||
"flate2",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ tokio = { version = "1", features = ["full"] }
|
|||
chrono = { version = "0.4", features = ["serde"] }
|
||||
uuid = { version = "1", features = ["v4", "serde"] }
|
||||
rusqlite = { version = "0.31", features = ["bundled"] }
|
||||
mysql_async = "0.34"
|
||||
mysql_async = { version = "0.34", features = ["chrono"] }
|
||||
reqwest = { version = "0.12", features = ["json", "multipart"] }
|
||||
base64 = "0.22"
|
||||
tokio-tungstenite = "0.23"
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
use mysql_async::{Pool, prelude::*};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use chrono::NaiveDateTime;
|
||||
|
||||
/// Verbindungskonfiguration
|
||||
const MYSQL_HOST: &str = "192.168.155.11";
|
||||
|
|
@ -91,11 +92,13 @@ pub async fn search_knowledge(
|
|||
LIMIT ?"#,
|
||||
(&query, &query, &cat, limit),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at, relevance):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String, f64)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime, f64)| {
|
||||
SearchResult {
|
||||
entry: KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
},
|
||||
relevance,
|
||||
}
|
||||
|
|
@ -113,11 +116,13 @@ pub async fn search_knowledge(
|
|||
LIMIT ?"#,
|
||||
(&query, &query, limit),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at, relevance):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String, f64)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime, f64)| {
|
||||
SearchResult {
|
||||
entry: KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
},
|
||||
relevance,
|
||||
}
|
||||
|
|
@ -145,10 +150,12 @@ pub async fn get_knowledge(id: i64) -> Result<Option<KnowledgeEntry>, String> {
|
|||
(id,)
|
||||
).await.map_err(|e| e.to_string())?
|
||||
.map(|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime)| {
|
||||
KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -223,10 +230,12 @@ pub async fn get_recent_knowledge(
|
|||
LIMIT ?"#,
|
||||
(&cat, limit),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime)| {
|
||||
KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
}
|
||||
).await.map_err(|e| e.to_string())?
|
||||
|
|
@ -240,10 +249,12 @@ pub async fn get_recent_knowledge(
|
|||
LIMIT ?"#,
|
||||
(limit,),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime)| {
|
||||
KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
}
|
||||
).await.map_err(|e| e.to_string())?
|
||||
|
|
@ -322,10 +333,12 @@ pub async fn get_tool_hints(
|
|||
LIMIT 3"#,
|
||||
(&cat, &query_string),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime)| {
|
||||
KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
}
|
||||
).await.map_err(|e| e.to_string())?
|
||||
|
|
@ -340,10 +353,12 @@ pub async fn get_tool_hints(
|
|||
LIMIT 3"#,
|
||||
(&query_string,),
|
||||
|(id, category, title, content, tags, priority, status, related_ids, source, created_at, updated_at):
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, String, String)| {
|
||||
(i64, String, String, String, Option<String>, i32, String, Option<String>, Option<String>, NaiveDateTime, NaiveDateTime)| {
|
||||
KnowledgeEntry {
|
||||
id, category, title, content, tags, priority, status,
|
||||
related_ids, source, created_at, updated_at,
|
||||
related_ids, source,
|
||||
created_at: created_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
updated_at: updated_at.format("%Y-%m-%d %H:%M:%S").to_string(),
|
||||
}
|
||||
}
|
||||
).await.map_err(|e| e.to_string())?
|
||||
|
|
|
|||
Loading…
Reference in a new issue