pub struct ReadTransaction { /* private fields */ }
Expand description
Transaction that allows only reading.
This is useful if one wants to make sure the observed database content doesn’t change for the
duration of the transaction even in the presence of concurrent writes. In other words - a read
transaction represents an immutable snapshot of the database at the point the transaction was
created. A read transaction doesn’t need to be committed or rolled back - it’s implicitly ended
when the ReadTransaction
instance drops.
Trait Implementations§
Source§impl Debug for ReadTransaction
impl Debug for ReadTransaction
Source§impl Deref for ReadTransaction
impl Deref for ReadTransaction
Source§impl DerefMut for ReadTransaction
impl DerefMut for ReadTransaction
Source§impl Drop for ReadTransaction
impl Drop for ReadTransaction
Source§impl<'t> Executor<'t> for &'t mut ReadTransaction
impl<'t> Executor<'t> for &'t mut ReadTransaction
type Database = Sqlite
Source§fn fetch_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<Either<SqliteQueryResult, SqliteRow>, Error>>where
E: Execute<'q, Sqlite> + 'q,
't: 'e,
fn fetch_many<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxStream<'e, Result<Either<SqliteQueryResult, SqliteRow>, Error>>where
E: Execute<'q, Sqlite> + 'q,
't: 'e,
Execute multiple queries and return the generated results as a stream
from each query, in a stream.
Source§fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<Option<SqliteRow>, Error>>where
E: Execute<'q, Sqlite> + 'q,
't: 'e,
fn fetch_optional<'e, 'q: 'e, E>(
self,
query: E,
) -> BoxFuture<'e, Result<Option<SqliteRow>, Error>>where
E: Execute<'q, Sqlite> + 'q,
't: 'e,
Execute the query and returns at most one row.
Source§fn prepare_with<'e, 'q: 'e>(
self,
sql: &'q str,
parameters: &'e [SqliteTypeInfo],
) -> BoxFuture<'e, Result<SqliteStatement<'q>, Error>>where
't: 'e,
fn prepare_with<'e, 'q: 'e>(
self,
sql: &'q str,
parameters: &'e [SqliteTypeInfo],
) -> BoxFuture<'e, Result<SqliteStatement<'q>, Error>>where
't: 'e,
Prepare the SQL query, with parameter type information, to inspect the
type information about its parameters and results. Read more
§fn execute<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn execute<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
Execute the query and return the total number of rows affected.
§fn execute_many<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn execute_many<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::QueryResult, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
Execute multiple queries and return the rows affected from each query, in a stream.
§fn fetch<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn fetch<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Stream<Item = Result<<Self::Database as Database>::Row, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
Execute the query and return the generated results as a stream.
§fn fetch_all<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
fn fetch_all<'e, 'q, E>(
self,
query: E,
) -> Pin<Box<dyn Future<Output = Result<Vec<<Self::Database as Database>::Row>, Error>> + Send + 'e>>where
'q: 'e,
'c: 'e,
E: 'q + Execute<'q, Self::Database>,
Execute the query and return all the generated results, collected into a
Vec
.Auto Trait Implementations§
impl Freeze for ReadTransaction
impl !RefUnwindSafe for ReadTransaction
impl Send for ReadTransaction
impl !Sync for ReadTransaction
impl Unpin for ReadTransaction
impl !UnwindSafe for ReadTransaction
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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