Struct ProxyDatabaseConnection
pub struct ProxyDatabaseConnection { /* private fields */ }Expand description
Defines a connection for the [ProxyDatabase]
Implementations§
§impl ProxyDatabaseConnection
impl ProxyDatabaseConnection
pub fn new(
db_backend: DbBackend,
funcs: Arc<Box<dyn ProxyDatabaseTrait>>,
) -> Self
pub fn new( db_backend: DbBackend, funcs: Arc<Box<dyn ProxyDatabaseTrait>>, ) -> Self
Create a connection to the [ProxyDatabase]
pub fn get_database_backend(&self) -> DbBackend
pub fn get_database_backend(&self) -> DbBackend
Get the DatabaseBackend being used by the [ProxyDatabase]
pub async fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
pub async fn execute(&self, statement: Statement) -> Result<ExecResult, DbErr>
Execute the SQL statement in the [ProxyDatabase]
pub async fn query_one(
&self,
statement: Statement,
) -> Result<Option<QueryResult>, DbErr>
pub async fn query_one( &self, statement: Statement, ) -> Result<Option<QueryResult>, DbErr>
Return one QueryResult if the query was successful
pub async fn query_all(
&self,
statement: Statement,
) -> Result<Vec<QueryResult>, DbErr>
pub async fn query_all( &self, statement: Statement, ) -> Result<Vec<QueryResult>, DbErr>
Return all QueryResults if the query was successful
pub async fn begin(&self)
pub async fn begin(&self)
Create a statement block of SQL statements that execute together.
pub async fn commit(&self)
pub async fn commit(&self)
Commit a transaction atomically to the database
pub async fn rollback(&self)
pub async fn rollback(&self)
Roll back a faulty transaction
pub fn start_rollback(&self)
pub fn start_rollback(&self)
Start rollback a transaction
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProxyDatabaseConnection
impl !RefUnwindSafe for ProxyDatabaseConnection
impl Send for ProxyDatabaseConnection
impl Sync for ProxyDatabaseConnection
impl Unpin for ProxyDatabaseConnection
impl !UnwindSafe for ProxyDatabaseConnection
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