pub struct SqliteBackend { /* private fields */ }Expand description
Default implementation wrapping a rusqlite Connection.
Implementations§
Source§impl SqliteBackend
impl SqliteBackend
pub fn new(conn: Connection) -> Self
pub fn into_inner(self) -> Connection
Trait Implementations§
Source§impl StorageBackend for SqliteBackend
impl StorageBackend for SqliteBackend
Source§fn execute_sql(
&self,
sql: &str,
params: &[&dyn ToSql],
) -> Result<usize, AppError>
fn execute_sql( &self, sql: &str, params: &[&dyn ToSql], ) -> Result<usize, AppError>
Execute a SQL statement and return the number of affected rows.
Source§fn query_one<T, F>(
&self,
sql: &str,
params: &[&dyn ToSql],
f: F,
) -> Result<Option<T>, AppError>
fn query_one<T, F>( &self, sql: &str, params: &[&dyn ToSql], f: F, ) -> Result<Option<T>, AppError>
Query a single row and map it with the provided closure.
Source§fn as_connection(&self) -> &Connection
fn as_connection(&self) -> &Connection
Returns a reference to the underlying rusqlite Connection.
Phase 1 escape hatch — will be removed when full migration is complete.
Auto Trait Implementations§
impl !Freeze for SqliteBackend
impl !RefUnwindSafe for SqliteBackend
impl Send for SqliteBackend
impl !Sync for SqliteBackend
impl Unpin for SqliteBackend
impl UnsafeUnpin for SqliteBackend
impl !UnwindSafe for SqliteBackend
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