(cg: &TraceDecay, fact_id: i64)
| 923 | } |
| 924 | |
| 925 | pub(crate) async fn fact_exists(cg: &TraceDecay, fact_id: i64) -> bool { |
| 926 | let conn = cg.db().conn(); |
| 927 | let mut rows = conn |
| 928 | .query( |
| 929 | "SELECT 1 FROM memory_facts WHERE fact_id = ?1 LIMIT 1", |
| 930 | libsql::params![fact_id], |
| 931 | ) |
| 932 | .await |
| 933 | .unwrap(); |
| 934 | rows.next().await.unwrap().is_some() |
| 935 | } |
| 936 | |
| 937 | pub(crate) async fn read_artifact( |
| 938 | cg: &TraceDecay, |