mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-09 17:39:35 +00:00
add yomitan.db cleanup (which doesn't help)
This commit is contained in:
1 parent
bd281a3b2e
commit
641f23538b
4 files changed
+19
-3
No files matched your search
@@ -73,6 +73,11 @@ impl YomitanWriter {
|
||||
Ok(Self { conn })
|
||||
}
|
||||
|
||||
pub fn cleanup(&self) -> Result<()> {
|
||||
self.conn.execute_batch("VACUUM")?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn create_schema(&mut self) -> Result<()> {
|
||||
self.conn.execute_batch(
|
||||
"
|
||||
|
||||
@@ -51,6 +51,13 @@ impl AppService {
|
||||
Ok(writer)
|
||||
}
|
||||
|
||||
pub fn cleanup_yomitan_writer(&self) -> Result<YomitanWriter, CJDicError> {
|
||||
let conn = Connection::open(self.db.dir.join(YOMITAN_DBFILE))?;
|
||||
let writer = YomitanWriter::new(conn)?;
|
||||
writer.cleanup()?;
|
||||
Ok(writer)
|
||||
}
|
||||
|
||||
pub fn load_yomitan_zip_dir<Z, LoadCallback, ImportCallback>(
|
||||
&self,
|
||||
zip_dir: Vec<Z>,
|
||||
@@ -145,7 +152,7 @@ impl AppService {
|
||||
}
|
||||
|
||||
pub fn import_yomitan_zip_file<Z, Callback>(
|
||||
writer: &mut YomitanWriter,
|
||||
writer: &mut YomitanWriter, // Reuse existing connection
|
||||
zip_file: &Z,
|
||||
lang: &str,
|
||||
progress_callback: Callback,
|
||||
|
||||
Reference in new issue
Block a user