From 9328fa0897907df10c81b95d292515a191651fe5 Mon Sep 17 00:00:00 2001 From: Ivan Ukhov Date: Sat, 8 Jun 2019 20:15:44 +0200 Subject: [PATCH] Add the two mutex-related flags --- src/connection.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/connection.rs b/src/connection.rs index 579e2dd..6d2d21f 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -170,6 +170,22 @@ impl ConnectionFlags { self } + /// Open the database in the serialized [threading mode][1]. + /// + /// [1]: https://www.sqlite.org/threadsafe.html + pub fn set_full_mutex(mut self) -> Self { + self.0 |= ffi::SQLITE_OPEN_FULLMUTEX; + self + } + + /// Opens the database in the multi-thread [threading mode][1]. + /// + /// [1]: https://www.sqlite.org/threadsafe.html + pub fn set_no_mutex(mut self) -> Self { + self.0 |= ffi::SQLITE_OPEN_NOMUTEX; + self + } + /// Open the database for reading only. pub fn set_read_only(mut self) -> Self { self.0 |= ffi::SQLITE_OPEN_READWRITE;