pub struct ClientBuilder { /* private fields */ }Expand description
A ClientBuilder can be used to create a Client with custom
configuration.
For more information on creating a sqlite connection, see the rusqlite docs.
§Examples
let client = ClientBuilder::new().path("path/to/db.sqlite3").open().await?;
// ...
client.close().await?;Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new ClientBuilder with the default settings.
Sourcepub fn path<P: AsRef<Path>>(self, path: P) -> Self
pub fn path<P: AsRef<Path>>(self, path: P) -> Self
Specify the path of the sqlite3 database to open.
By default, an in-memory database is used.
Sourcepub fn flags(self, flags: OpenFlags) -> Self
pub fn flags(self, flags: OpenFlags) -> Self
Specify the OpenFlags to use when opening a new connection.
By default, OpenFlags::default() is used.
Sourcepub fn journal_mode(self, journal_mode: JournalMode) -> Self
pub fn journal_mode(self, journal_mode: JournalMode) -> Self
Specify the JournalMode to set when opening a new connection.
By default, no journal_mode is explicity set.
Sourcepub fn queue_capacity(self, queue_capacity: usize) -> Self
pub fn queue_capacity(self, queue_capacity: usize) -> Self
Limit the number of commands that may wait in the worker queue.
By default, the queue is unbounded. If a capacity is configured, calls
return Error::QueueFull when that many commands are already waiting
for the worker thread. A capacity of 0 allows a command to be accepted
only when the worker is ready to receive it immediately.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more