Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: Introduce `Profile::database_mut`
Lorenz Leutgeb committed 2 months ago
commit 0216893bd2364c96a9cd4d902b5599d56f2c075c
parent 25186909fd75c962c1fd8bcc742f86442f0eefdc
1 file changed +9 -0
modified crates/radicle/src/profile.rs
@@ -419,6 +419,15 @@ impl Profile {
            Err(e) => Err(e.into()),
        }
    }
+

+
    /// Return a handle to the database of the node, with SQLite configuration
+
    /// from [`Self::config`] applied.
+
    pub fn database_mut(&self) -> Result<node::Database, node::db::Error> {
+
        self.home
+
            .database_mut()?
+
            .journal_mode(self.config.node.database.sqlite.pragma.journal_mode)?
+
            .synchronous(self.config.node.database.sqlite.pragma.synchronous)
+
    }
}

impl std::ops::Deref for Profile {