| 1923 | } |
| 1924 | |
| 1925 | pub fn insert_error_solution( |
| 1926 | &self, |
| 1927 | pattern_id: i64, |
| 1928 | solution: &str, |
| 1929 | outcome: &str, |
| 1930 | applied_at: u64, |
| 1931 | token_cost: i64, |
| 1932 | ) -> Result<i64> { |
| 1933 | self.conn.execute( |
| 1934 | "INSERT INTO error_solutions (pattern_id, solution, outcome, applied_at, token_cost) VALUES (?1,?2,?3,?4,?5)", |
| 1935 | rusqlite::params![pattern_id, solution, outcome, applied_at as i64, token_cost], |
| 1936 | )?; |
| 1937 | Ok(self.conn.last_insert_rowid()) |
| 1938 | } |
| 1939 | |
| 1940 | pub fn find_error_patterns_by_hash(&self, hash: &str) -> Result<Vec<engine::ErrorPattern>> { |
| 1941 | let mut stmt = self.conn.prepare( |