[][src]Trait rbatis::crud::CRUD

pub trait CRUD {
#[must_use]    fn save<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        entity: &'life2 T
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        entity: &'life2 [T]
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn remove_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        w: &'life2 Wrapper
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn remove_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        id: &'life2 T::IdType
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn remove_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        ids: &'life2 [T::IdType]
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn update_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        arg: &'life2 T,
        w: &'life3 Wrapper,
        update_null_value: bool
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn update_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        arg: &'life2 T
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn update_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        ids: &'life2 [T]
    ) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn fetch_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        w: &'life2 Wrapper
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn fetch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        id: &'life2 T::IdType
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn fetch_page_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        w: &'life2 Wrapper,
        page: &'life3 dyn IPageRequest
    ) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn list<'life0, 'life1, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn list_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        w: &'life2 Wrapper
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn list_by_ids<'life0, 'life1, 'life2, 'async_trait, T>(
        &'life0 self,
        tx_id: &'life1 str,
        ids: &'life2 [T::IdType]
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>
    where
        T: CRUDEnable,
        T: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; }

Required methods

#[must_use]fn save<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    entity: &'life2 T
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

tx_id: Transaction id,default ""

#[must_use]fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    entity: &'life2 [T]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn remove_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn remove_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn remove_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn update_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    arg: &'life2 T,
    w: &'life3 Wrapper,
    update_null_value: bool
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn update_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    arg: &'life2 T
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn update_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    ids: &'life2 [T]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn fetch_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn fetch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    id: &'life2 T::IdType
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn fetch_page_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    w: &'life2 Wrapper,
    page: &'life3 dyn IPageRequest
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn list<'life0, 'life1, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

fetch all record

#[must_use]fn list_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    w: &'life2 Wrapper
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

#[must_use]fn list_by_ids<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 

Loading content...

Implementors

impl CRUD for Rbatis[src]

fn save<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    entity: &'life2 T
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

save one entity to database

fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    args: &'life2 [T]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

save batch makes many value into only one sql. make sure your data not to long!

for Example: rb.save_batch(&vec![activity]); [rbatis] Exec ==> INSERT INTO biz_activity (id,name,version) VALUES ( ? , ? , ?),( ? , ? , ?)

fn remove_batch_by_id<'life0, 'life1, 'life2, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    ids: &'life2 [T::IdType]
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

remove batch id for Example : rb.remove_batch_by_id::(&["1".to_string(),"2".to_string()]).await; [rbatis] Exec ==> DELETE FROM biz_activity WHERE id IN ( ? , ? )

fn update_by_wrapper<'life0, 'life1, 'life2, 'life3, 'async_trait, T>(
    &'life0 self,
    tx_id: &'life1 str,
    arg: &'life2 T,
    w: &'life3 Wrapper,
    update_null_value: bool
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>> where
    T: CRUDEnable,
    T: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

update arg by wrapper

Loading content...