mirror of
https://github.com/chatmail/core.git
synced 2026-05-22 08:16:32 +03:00
refactor(sql): make open flags immutable
This commit is contained in:
@@ -671,10 +671,9 @@ impl Sql {
|
|||||||
/// `passphrase` is the SQLCipher database passphrase.
|
/// `passphrase` is the SQLCipher database passphrase.
|
||||||
/// Empty string if database is not encrypted.
|
/// Empty string if database is not encrypted.
|
||||||
fn new_connection(path: &Path, passphrase: &str) -> Result<Connection> {
|
fn new_connection(path: &Path, passphrase: &str) -> Result<Connection> {
|
||||||
let mut flags = OpenFlags::SQLITE_OPEN_NO_MUTEX;
|
let flags = OpenFlags::SQLITE_OPEN_NO_MUTEX
|
||||||
flags.insert(OpenFlags::SQLITE_OPEN_READ_WRITE);
|
| OpenFlags::SQLITE_OPEN_READ_WRITE
|
||||||
flags.insert(OpenFlags::SQLITE_OPEN_CREATE);
|
| OpenFlags::SQLITE_OPEN_CREATE;
|
||||||
|
|
||||||
let conn = Connection::open_with_flags(path, flags)?;
|
let conn = Connection::open_with_flags(path, flags)?;
|
||||||
conn.execute_batch(
|
conn.execute_batch(
|
||||||
"PRAGMA cipher_memory_security = OFF; -- Too slow on Android
|
"PRAGMA cipher_memory_security = OFF; -- Too slow on Android
|
||||||
|
|||||||
Reference in New Issue
Block a user