Struct rgb_lib_migration::sea_orm::query::TryInsert
pub struct TryInsert<A>where
A: ActiveModelTrait,{ /* private fields */ }
Expand description
Performs INSERT operations on a ActiveModel, will do nothing if input is empty.
All functions works the same as if it is Insert. Please refer to Insert page for more information
Implementations§
§impl<A> TryInsert<A>where
A: ActiveModelTrait,
impl<A> TryInsert<A>where A: ActiveModelTrait,
pub async fn exec<'a, C>(
self,
db: &'a C
) -> Result<TryInsertResult<InsertResult<A>>, DbErr>where
C: ConnectionTrait,
A: 'a,
pub async fn exec<'a, C>( self, db: &'a C ) -> Result<TryInsertResult<InsertResult<A>>, DbErr>where C: ConnectionTrait, A: 'a,
Execute an insert operation
pub async fn exec_without_returning<'a, C>(
self,
db: &'a C
) -> Result<TryInsertResult<u64>, DbErr>where
<<A as ActiveModelTrait>::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait,
A: 'a,
pub async fn exec_without_returning<'a, C>( self, db: &'a C ) -> Result<TryInsertResult<u64>, DbErr>where <<A as ActiveModelTrait>::Entity as EntityTrait>::Model: IntoActiveModel<A>, C: ConnectionTrait, A: 'a,
Execute an insert operation without returning (don’t use RETURNING
syntax)
Number of rows affected is returned
pub async fn exec_with_returning<'a, C>(
self,
db: &'a C
) -> Result<TryInsertResult<<<A as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>where
<<A as ActiveModelTrait>::Entity as EntityTrait>::Model: IntoActiveModel<A>,
C: ConnectionTrait,
A: 'a,
pub async fn exec_with_returning<'a, C>( self, db: &'a C ) -> Result<TryInsertResult<<<A as ActiveModelTrait>::Entity as EntityTrait>::Model>, DbErr>where <<A as ActiveModelTrait>::Entity as EntityTrait>::Model: IntoActiveModel<A>, C: ConnectionTrait, A: 'a,
Execute an insert operation and return the inserted model (use RETURNING
syntax if supported)
§impl<A> TryInsert<A>where
A: ActiveModelTrait,
impl<A> TryInsert<A>where A: ActiveModelTrait,
pub fn one<M>(m: M) -> TryInsert<A>where M: IntoActiveModel<A>,
pub fn many<M, I>(models: I) -> TryInsert<A>where M: IntoActiveModel<A>, I: IntoIterator<Item = M>,
pub fn add<M>(self, m: M) -> TryInsert<A>where M: IntoActiveModel<A>,
pub fn add_many<M, I>(self, models: I) -> TryInsert<A>where M: IntoActiveModel<A>, I: IntoIterator<Item = M>,
pub fn on_conflict(self, on_conflict: OnConflict) -> TryInsert<A>
pub fn from_insert(insert: Insert<A>) -> TryInsert<A>
Trait Implementations§
§impl<A> Debug for TryInsert<A>where
A: Debug + ActiveModelTrait,
impl<A> Debug for TryInsert<A>where A: Debug + ActiveModelTrait,
§impl<A> Default for TryInsert<A>where
A: ActiveModelTrait,
impl<A> Default for TryInsert<A>where A: ActiveModelTrait,
§impl<A> QueryTrait for TryInsert<A>where
A: ActiveModelTrait,
impl<A> QueryTrait for TryInsert<A>where A: ActiveModelTrait,
§type QueryStatement = InsertStatement
type QueryStatement = InsertStatement
Constrain the QueryStatement to QueryStatementBuilder trait
§fn query(&mut self) -> &mut InsertStatement
fn query(&mut self) -> &mut InsertStatement
Get a mutable ref to the query builder
§fn as_query(&self) -> &InsertStatement
fn as_query(&self) -> &InsertStatement
Get an immutable ref to the query builder
§fn into_query(self) -> InsertStatement
fn into_query(self) -> InsertStatement
Take ownership of the query builder
§fn build(&self, db_backend: DatabaseBackend) -> Statement
fn build(&self, db_backend: DatabaseBackend) -> Statement
Build the query as
Statement
Auto Trait Implementations§
impl<A> !RefUnwindSafe for TryInsert<A>
impl<A> Send for TryInsert<A>where A: Send,
impl<A> Sync for TryInsert<A>where A: Sync,
impl<A> Unpin for TryInsert<A>where A: Unpin,
impl<A> !UnwindSafe for TryInsert<A>
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