pub struct OpenOptions { /* private fields */ }Expand description
Options that can be used to customize the opening of a SQLite database.
Implementations§
Source§impl OpenOptions
impl OpenOptions
Sourcepub fn open(&self, path: impl AsRef<Path>) -> Result<Connection>
Available on crate feature std only.
pub fn open(&self, path: impl AsRef<Path>) -> Result<Connection>
std only.Open a database to the given path.
Note that it is possible to open an in-memory database by passing
":memory:" here, this call might require allocating depending on the
platform, so it should be avoided in favor of using memory. To avoid
allocating for regular paths, you can use open_c_str, however you
are responsible for ensuring the c-string is a valid path.
Sourcepub fn open_c_str(&self, name: &CStr) -> Result<Connection>
pub fn open_c_str(&self, name: &CStr) -> Result<Connection>
Open a database connection with a raw c-string.
This can be used to open in-memory databases by passing c":memory:" or
a regular open call with a filesystem path like
c"/path/to/database.sql".
Sourcepub fn memory(&self) -> Result<Connection>
pub fn memory(&self) -> Result<Connection>
Open an in-memory database.
Sourcepub fn set_create(self) -> Self
pub fn set_create(self) -> Self
Create the database if it does not already exist.
Sourcepub fn set_full_mutex(self) -> Self
pub fn set_full_mutex(self) -> Self
Open the database in the serialized threading mode.
Sourcepub fn set_no_mutex(self) -> Self
pub fn set_no_mutex(self) -> Self
Opens the database in the multi-thread threading mode.
Sourcepub fn set_read_only(self) -> Self
pub fn set_read_only(self) -> Self
Open the database for reading only.
Sourcepub fn set_read_write(self) -> Self
pub fn set_read_write(self) -> Self
Open the database for reading and writing.
Trait Implementations§
Source§impl Clone for OpenOptions
impl Clone for OpenOptions
Source§fn clone(&self) -> OpenOptions
fn clone(&self) -> OpenOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more