aboutsummaryrefslogtreecommitdiff
path: root/src/db/open.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/open.rs')
-rw-r--r--src/db/open.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/db/open.rs b/src/db/open.rs
index ae135c4e..59d06f2e 100644
--- a/src/db/open.rs
+++ b/src/db/open.rs
@@ -91,14 +91,8 @@ pub fn open_db(path: &PathBuf, engine: Engine, opt: &OpenOpt) -> Result<Db> {
#[cfg(feature = "sqlite")]
Engine::Sqlite => {
info!("Opening Sqlite database at: {}", path.display());
- let db = crate::sqlite_adapter::rusqlite::Connection::open(&path)?;
- db.pragma_update(None, "journal_mode", "WAL")?;
- if opt.fsync {
- db.pragma_update(None, "synchronous", "NORMAL")?;
- } else {
- db.pragma_update(None, "synchronous", "OFF")?;
- }
- Ok(crate::sqlite_adapter::SqliteDb::init(db))
+ let manager = r2d2_sqlite::SqliteConnectionManager::file(path);
+ Ok(crate::sqlite_adapter::SqliteDb::new(manager, opt.fsync)?)
}
// ---- LMDB DB ----