pub struct TransactionBuilder { /* private fields */ }
Expand description
Transaction builder for batching multiple database operations
Implementations§
Source§impl TransactionBuilder
impl TransactionBuilder
Sourcepub fn insert(self, table: &str, data: JsonValue) -> Self
pub fn insert(self, table: &str, data: JsonValue) -> Self
Add an INSERT operation to the transaction
Sourcepub fn update(self, table: &str, data: JsonValue, where_clause: &str) -> Self
pub fn update(self, table: &str, data: JsonValue, where_clause: &str) -> Self
Add an UPDATE operation to the transaction
Sourcepub fn delete(self, table: &str, where_clause: &str) -> Self
pub fn delete(self, table: &str, where_clause: &str) -> Self
Add a DELETE operation to the transaction
Sourcepub fn select(
self,
table: &str,
columns: &str,
where_clause: Option<&str>,
) -> Self
pub fn select( self, table: &str, columns: &str, where_clause: Option<&str>, ) -> Self
Add a SELECT operation to the transaction
Sourcepub fn rpc(self, function_name: &str, params: JsonValue) -> Self
pub fn rpc(self, function_name: &str, params: JsonValue) -> Self
Add an RPC call to the transaction
Sourcepub async fn commit<T>(self) -> Result<Vec<T>>where
T: for<'de> Deserialize<'de>,
pub async fn commit<T>(self) -> Result<Vec<T>>where
T: for<'de> Deserialize<'de>,
Commit the transaction and execute all operations
Trait Implementations§
Source§impl Clone for TransactionBuilder
impl Clone for TransactionBuilder
Source§fn clone(&self) -> TransactionBuilder
fn clone(&self) -> TransactionBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for TransactionBuilder
impl !RefUnwindSafe for TransactionBuilder
impl Send for TransactionBuilder
impl Sync for TransactionBuilder
impl Unpin for TransactionBuilder
impl !UnwindSafe for TransactionBuilder
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