diff options
Diffstat (limited to 'src/db/bin/convert.rs')
-rw-r--r-- | src/db/bin/convert.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/db/bin/convert.rs b/src/db/bin/convert.rs index bbde2048..957deedf 100644 --- a/src/db/bin/convert.rs +++ b/src/db/bin/convert.rs @@ -48,6 +48,8 @@ fn open_db(path: PathBuf, engine: String) -> Result<Db> { } "sqlite" | "sqlite3" | "rusqlite" => { let db = sqlite_adapter::rusqlite::Connection::open(&path)?; + db.pragma_update(None, "journal_mode", &"WAL")?; + db.pragma_update(None, "synchronous", &"NORMAL")?; Ok(sqlite_adapter::SqliteDb::init(db)) } "lmdb" | "heed" => { @@ -57,11 +59,13 @@ fn open_db(path: PathBuf, engine: String) -> Result<Db> { let map_size = lmdb_adapter::recommended_map_size(); - let db = lmdb_adapter::heed::EnvOpenOptions::new() - .max_dbs(100) - .map_size(map_size) - .open(&path) - .unwrap(); + let mut env_builder = lmdb_adapter::heed::EnvOpenOptions::new(); + env_builder.max_dbs(100); + env_builder.map_size(map_size); + unsafe { + env_builder.flag(heed::flags::Flags::MdbNoMetaSync); + } + let db = env_builder.open(&path)?; Ok(lmdb_adapter::LmdbDb::init(db)) } e => Err(Error(format!("Invalid DB engine: {}", e).into())), |