[−][src]Struct butane_core::db::Transaction
Database transaction.
Begin a transaction using the BackendConnection
transaction
method.
Implementations
impl<'c> Transaction<'c>
[src]
pub fn commit(mut self: Self) -> Result<()>
[src]
Commit the transaction
pub fn rollback(mut self: Self) -> Result<()>
[src]
Roll back the transaction. Equivalent to dropping it.
Trait Implementations
impl ConnectionMethods for Transaction<'_>
[src]
pub fn execute(&self, sql: &str) -> Result<()>
[src]
pub fn query(
&self,
table: &'static str,
columns: &[Column],
expr: Option<BoolExpr>,
limit: Option<i32>
) -> Result<RawQueryResult>
[src]
&self,
table: &'static str,
columns: &[Column],
expr: Option<BoolExpr>,
limit: Option<i32>
) -> Result<RawQueryResult>
pub fn insert_returning_pk(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlVal]
) -> Result<SqlVal>
[src]
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlVal]
) -> Result<SqlVal>
pub fn insert_only(
&self,
table: &'static str,
columns: &[Column],
values: &[SqlVal]
) -> Result<()>
[src]
&self,
table: &'static str,
columns: &[Column],
values: &[SqlVal]
) -> Result<()>
pub fn insert_or_replace(
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlVal]
) -> Result<()>
[src]
&self,
table: &'static str,
columns: &[Column],
pkcol: &Column,
values: &[SqlVal]
) -> Result<()>
pub fn update(
&self,
table: &'static str,
pkcol: Column,
pk: SqlVal,
columns: &[Column],
values: &[SqlVal]
) -> Result<()>
[src]
&self,
table: &'static str,
pkcol: Column,
pk: SqlVal,
columns: &[Column],
values: &[SqlVal]
) -> Result<()>
pub fn delete_where(&self, table: &'static str, expr: BoolExpr) -> Result<usize>
[src]
pub fn has_table(&self, table: &'static str) -> Result<bool>
[src]
pub fn delete(
&self,
table: &'static str,
pkcol: &'static str,
pk: SqlVal
) -> Result<()>
[src]
&self,
table: &'static str,
pkcol: &'static str,
pk: SqlVal
) -> Result<()>
Auto Trait Implementations
impl<'c> !RefUnwindSafe for Transaction<'c>
[src]
impl<'c> !Send for Transaction<'c>
[src]
impl<'c> !Sync for Transaction<'c>
[src]
impl<'c> Unpin for Transaction<'c>
[src]
impl<'c> !UnwindSafe for Transaction<'c>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,