aboutsummaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/db')
-rw-r--r--src/db/lib.rs2
-rw-r--r--src/db/lmdb_adapter.rs2
-rw-r--r--src/db/sqlite_adapter.rs9
3 files changed, 8 insertions, 5 deletions
diff --git a/src/db/lib.rs b/src/db/lib.rs
index 3485745a..c55c8643 100644
--- a/src/db/lib.rs
+++ b/src/db/lib.rs
@@ -122,7 +122,7 @@ impl Db {
_ => unreachable!(),
},
Err(TxError::Db(e2)) => match ret {
- // Ok was stored -> the error occured when finalizing
+ // Ok was stored -> the error occurred when finalizing
// transaction
Ok(_) => Err(TxError::Db(e2)),
// An error was already stored: that's the one we want to
diff --git a/src/db/lmdb_adapter.rs b/src/db/lmdb_adapter.rs
index de4c3910..40f1c867 100644
--- a/src/db/lmdb_adapter.rs
+++ b/src/db/lmdb_adapter.rs
@@ -233,7 +233,7 @@ impl<'a> LmdbTx<'a> {
fn get_tree(&self, i: usize) -> TxOpResult<&Database> {
self.trees.get(i).ok_or_else(|| {
TxOpError(Error(
- "invalid tree id (it might have been openned after the transaction started)".into(),
+ "invalid tree id (it might have been opened after the transaction started)".into(),
))
})
}
diff --git a/src/db/sqlite_adapter.rs b/src/db/sqlite_adapter.rs
index 9c9a668d..ce6412b6 100644
--- a/src/db/sqlite_adapter.rs
+++ b/src/db/sqlite_adapter.rs
@@ -142,11 +142,14 @@ impl IDb for SqliteDb {
fn snapshot(&self, to: &PathBuf) -> Result<()> {
fn progress(p: rusqlite::backup::Progress) {
let percent = (p.pagecount - p.remaining) * 100 / p.pagecount;
- info!("Sqlite snapshot progres: {}%", percent);
+ info!("Sqlite snapshot progress: {}%", percent);
}
+ std::fs::create_dir_all(to)?;
+ let mut path = to.clone();
+ path.push("db.sqlite");
self.db
.get()?
- .backup(rusqlite::DatabaseName::Main, to, Some(progress))?;
+ .backup(rusqlite::DatabaseName::Main, path, Some(progress))?;
Ok(())
}
@@ -304,7 +307,7 @@ impl<'a> SqliteTx<'a> {
fn get_tree(&self, i: usize) -> TxOpResult<&'_ str> {
self.trees.get(i).map(Arc::as_ref).ok_or_else(|| {
TxOpError(Error(
- "invalid tree id (it might have been openned after the transaction started)".into(),
+ "invalid tree id (it might have been opened after the transaction started)".into(),
))
})
}