diff options
| author | jakka <jakkadoujin@gmail.com> | 2025-06-21 21:16:31 +0300 |
|---|---|---|
| committer | jakka <jakkadoujin@gmail.com> | 2025-06-21 21:16:31 +0300 |
| commit | 28c2886e6ec048054dec0a4ba092ed68d8f21b28 (patch) | |
| tree | 5973ead70669311d8d11da868b4443fc37f71cc6 /src/db.rs | |
| parent | 341add84dcb7bff9d3b2597d83f9163038cc0a92 (diff) | |
moved vacuum function to its mod
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> { |
