mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
sqlite: add SqliteConnectOptions::shared_cache() (#1177)
This makes it possible to open database in shared cache mode without having to construct `sqlite://` URL with `?cache=shared` flag.
This commit is contained in:
parent
b5928f6e7f
commit
405474b575
@ -105,6 +105,14 @@ impl SqliteConnectOptions {
|
||||
self
|
||||
}
|
||||
|
||||
/// Set the [`SQLITE_OPEN_SHAREDCACHE` flag](https://sqlite.org/sharedcache.html).
|
||||
///
|
||||
/// By default, this is disabled.
|
||||
pub fn shared_cache(mut self, on: bool) -> Self {
|
||||
self.shared_cache = on;
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets the [journal mode](https://www.sqlite.org/pragma.html#pragma_journal_mode) for the database connection.
|
||||
///
|
||||
/// The default journal mode is WAL. For most use cases this can be significantly faster but
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user