MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / quick_check

Method quick_check

src/db/connection.rs:279–298  ·  view source on GitHub ↗

Runs `PRAGMA quick_check` and returns `true` if the database is intact. This is faster than `integrity_check` — it verifies B-tree structure without cross-checking index contents against table data.

(&self)

Source from the content-addressed store, hash-verified

277 /// This is faster than `integrity_check` — it verifies B-tree structure
278 /// without cross-checking index contents against table data.
279 pub async fn quick_check(&self) -> Result<bool> {
280 let mut rows = self
281 .conn
282 .query("PRAGMA quick_check", ())
283 .await
284 .map_err(|e| TraceDecayError::Database {
285 message: format!("failed to run quick_check: {e}"),
286 operation: "quick_check".to_string(),
287 })?;
288
289 if let Some(row) = rows.next().await.map_err(|e| TraceDecayError::Database {
290 message: format!("failed to read quick_check result: {e}"),
291 operation: "quick_check".to_string(),
292 })? {
293 let result: String = row.get::<String>(0).unwrap_or_default();
294 Ok(result == "ok")
295 } else {
296 Ok(false)
297 }
298 }
299
300 /// Rebuilds the FTS5 index from the content table.
301 ///

Calls

no outgoing calls