aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/Cargo.toml2
-rw-r--r--src/model/garage.rs6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/model/Cargo.toml b/src/model/Cargo.toml
index 6dc954d4..c4291c32 100644
--- a/src/model/Cargo.toml
+++ b/src/model/Cargo.toml
@@ -41,7 +41,7 @@ opentelemetry = "0.17"
netapp = "0.5"
[features]
-default = [ "sled" ]
+default = [ "sled", "lmdb", "sqlite" ]
k2v = [ "garage_util/k2v" ]
lmdb = [ "garage_db/lmdb" ]
sled = [ "garage_db/sled" ]
diff --git a/src/model/garage.rs b/src/model/garage.rs
index 3daa1b33..0fbcf334 100644
--- a/src/model/garage.rs
+++ b/src/model/garage.rs
@@ -109,6 +109,11 @@ impl Garage {
db_path.push("db.sqlite");
info!("Opening Sqlite database at: {}", db_path.display());
let db = db::sqlite_adapter::rusqlite::Connection::open(db_path)
+ .and_then(|db| {
+ db.pragma_update(None, "journal_mode", &"WAL")?;
+ db.pragma_update(None, "synchronous", &"NORMAL")?;
+ Ok(db)
+ })
.ok_or_message("Unable to open sqlite DB")?;
db::sqlite_adapter::SqliteDb::init(db)
}
@@ -133,7 +138,6 @@ impl Garage {
env_builder.max_readers(500);
env_builder.map_size(map_size);
unsafe {
- env_builder.flag(heed::flags::Flags::MdbNoSync);
env_builder.flag(heed::flags::Flags::MdbNoMetaSync);
}
let db = match env_builder.open(&db_path) {