pub struct SqliteDb { /* private fields */ }Expand description
The pool, and the one connection of it the store holds. Statements and transactions take turns, so a request’s insert can never land inside an import’s open transaction, and a rollback can only undo the transaction’s own writes.
Implementations§
Trait Implementations§
Source§impl Db for SqliteDb
impl Db for SqliteDb
Source§fn all<'a>(
&'a self,
sql: &'a str,
params: Vec<Param>,
) -> BoxFuture<'a, Result<Vec<Row>, DbError>>
fn all<'a>( &'a self, sql: &'a str, params: Vec<Param>, ) -> BoxFuture<'a, Result<Vec<Row>, DbError>>
Runs a query and gives its rows.
Source§fn run<'a>(
&'a self,
sql: &'a str,
params: Vec<Param>,
) -> BoxFuture<'a, Result<u64, DbError>>
fn run<'a>( &'a self, sql: &'a str, params: Vec<Param>, ) -> BoxFuture<'a, Result<u64, DbError>>
Runs a statement and says how many rows it matched.
Source§fn hold(&self, kind: Hold) -> BoxFuture<'_, Result<Arc<dyn Db>, DbError>>
fn hold(&self, kind: Hold) -> BoxFuture<'_, Result<Arc<dyn Db>, DbError>>
One connection, held for a transaction or a lock until
finish. Statements on it run in
turn with nothing else of the store’s in between. Holding a transaction on a connection
already in one joins it.Source§fn finish(
&self,
_ok: bool,
) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + '_>>
fn finish( &self, _ok: bool, ) -> Pin<Box<dyn Future<Output = Result<(), DbError>> + Send + '_>>
Ends what
hold began: commits a transaction (ok) or rolls it back, or lets go of a lock.
A connection that was not held answers Ok.Auto Trait Implementations§
impl !RefUnwindSafe for SqliteDb
impl !UnwindSafe for SqliteDb
impl Freeze for SqliteDb
impl Send for SqliteDb
impl Sync for SqliteDb
impl Unpin for SqliteDb
impl UnsafeUnpin for SqliteDb
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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