pub struct Transaction { /* private fields */ }Expand description
ORM operations pinned to one transaction connection on either backend.
Implementations§
Source§impl Transaction
impl Transaction
pub async fn execute(&self, ast: QueryAst) -> Result<ExecuteResult, OrmError>
pub async fn insert<M: Model>( &self, model: &M, ) -> Result<ExecuteResult, OrmError>
pub async fn fetch_all<M: Model + Send + 'static>( &self, query: SelectQuery<M>, ) -> Result<Vec<M>, OrmError>
pub async fn fetch_one<M: Model + Send + 'static>( &self, query: SelectQuery<M>, ) -> Result<Option<M>, OrmError>
pub async fn get<M: Model + Send + 'static>( &self, id: M::PrimaryKey, ) -> Result<Option<M>, OrmError>
pub async fn all<M: Model + Send + 'static>(&self) -> Result<Vec<M>, OrmError>
pub async fn count<M: Model + Send + 'static>(&self) -> Result<usize, OrmError>
pub async fn delete<M: Model + Send + 'static>( &self, id: M::PrimaryKey, ) -> Result<bool, OrmError>
pub fn create<M: Model>(&self) -> TransactionCreateBuilder<'_, M>
pub fn update<M: Model>( &self, id: M::PrimaryKey, ) -> TransactionUpdateBuilder<'_, M>
pub fn query<M: Model>(&self) -> TransactionQuery<'_, M>
pub async fn fetch_by_many<M, T, I, V>( &self, field: ModelField<M, T>, values: I, ) -> Result<Vec<M>, OrmError>
Auto Trait Implementations§
impl !RefUnwindSafe for Transaction
impl !UnwindSafe for Transaction
impl Freeze for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnsafeUnpin for Transaction
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