diff options
Diffstat (limited to 'src/db.rs')
| -rw-r--r-- | src/db.rs | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -22,7 +22,7 @@ const DEDUPE_DB: &str = "DELETE FROM flacs WHERE rowid NOT IN (SELECT MAX(rowid) FROM flacs GROUP BY path)"; #[derive(Debug, Clone)] -pub struct Database(pub Connection); +pub struct Database(Connection); impl Database { pub async fn new(path: impl AsRef<Path>) -> Result<Self> { @@ -132,6 +132,11 @@ impl Database { .unwrap() .get::<u64>(0)?) } + + pub async fn vaccum(&self) -> Result<()> { + self.0.execute("VACUUM", ()).await?; + Ok(()) + } } pub async fn open_default_db() -> Result<Database> { |
