(cg: &crate::tracedecay::TraceDecay)
| 246 | } |
| 247 | |
| 248 | async fn read_journal_mode(cg: &crate::tracedecay::TraceDecay) -> Result<String> { |
| 249 | let mut rows = cg |
| 250 | .db() |
| 251 | .conn() |
| 252 | .query("PRAGMA journal_mode", ()) |
| 253 | .await |
| 254 | .map_err(|e| TraceDecayError::Database { |
| 255 | message: format!("failed to read journal_mode: {e}"), |
| 256 | operation: "read_journal_mode".to_string(), |
| 257 | })?; |
| 258 | let row = rows |
| 259 | .next() |
| 260 | .await |
| 261 | .map_err(|e| TraceDecayError::Database { |
| 262 | message: format!("failed to read journal_mode row: {e}"), |
| 263 | operation: "read_journal_mode".to_string(), |
| 264 | })? |
| 265 | .ok_or_else(|| TraceDecayError::Database { |
| 266 | message: "no journal_mode row returned".to_string(), |
| 267 | operation: "read_journal_mode".to_string(), |
| 268 | })?; |
| 269 | row.get::<String>(0).map_err(|e| TraceDecayError::Database { |
| 270 | message: format!("failed to decode journal_mode: {e}"), |
| 271 | operation: "read_journal_mode".to_string(), |
| 272 | }) |
| 273 | } |
| 274 | |
| 275 | async fn read_source_total_bytes(cg: &crate::tracedecay::TraceDecay) -> Result<u64> { |
| 276 | let mut rows = cg |
no test coverage detected