summaryrefslogtreecommitdiff
path: root/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.rs')
-rw-r--r--src/db.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/db.rs b/src/db.rs
index 7ca313b..dd32171 100644
--- a/src/db.rs
+++ b/src/db.rs
@@ -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> {