pub struct HardenedSqlite { /* private fields */ }Expand description
Builder for a hardened SqlitePool.
Implementations§
Source§impl HardenedSqlite
impl HardenedSqlite
Sourcepub fn new(url: impl Into<String>) -> Self
pub fn new(url: impl Into<String>) -> Self
New builder with the hardened defaults: WAL, foreign_keys ON, busy_timeout 5s, synchronous NORMAL, create_if_missing, max_connections 8.
pub fn journal_mode(self, m: SqliteJournalMode) -> Self
pub fn foreign_keys(self, on: bool) -> Self
pub fn busy_timeout(self, d: Duration) -> Self
pub fn synchronous(self, s: SqliteSynchronous) -> Self
pub fn create_if_missing(self, on: bool) -> Self
pub fn max_connections(self, n: u32) -> Self
pub fn min_connections(self, n: u32) -> Self
Sourcepub fn memory_name(self, name: impl Into<String>) -> Self
pub fn memory_name(self, name: impl Into<String>) -> Self
Force a specific shared-cache in-memory name (else auto-salted).
Sourcepub fn connect_options(&self) -> Result<SqliteConnectOptions>
pub fn connect_options(&self) -> Result<SqliteConnectOptions>
Build the SqliteConnectOptions without connecting.
Sourcepub fn pragma_statements(&self) -> Vec<String>
pub fn pragma_statements(&self) -> Vec<String>
The PRAGMA statements this builder would apply, in order — for callers on rusqlite or another driver who want the same hardening without the sqlx pool. WAL is omitted for in-memory configurations.
Sourcepub async fn connect(self) -> Result<SqlitePool>
pub async fn connect(self) -> Result<SqlitePool>
Build and connect the pool.
Auto Trait Implementations§
impl Freeze for HardenedSqlite
impl RefUnwindSafe for HardenedSqlite
impl Send for HardenedSqlite
impl Sync for HardenedSqlite
impl Unpin for HardenedSqlite
impl UnsafeUnpin for HardenedSqlite
impl UnwindSafe for HardenedSqlite
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more