compact.rs

 1use anyhow::Result;
 2use std::path::Path;
 3
 4use crate::db;
 5
 6pub fn run(root: &Path) -> Result<()> {
 7    let conn = db::open(root)?;
 8    let c = crate::color::stderr_theme();
 9    eprintln!("{}info:{} vacuuming database...", c.blue, c.reset);
10    conn.execute_batch("VACUUM;")?;
11    eprintln!("{}info:{} done", c.blue, c.reset);
12    Ok(())
13}