pub struct MyBatisConnExecutor<'a> {
pub conn: DBPoolConn<'a>,
pub rb: &'a Mybatis,
}Fields§
§conn: DBPoolConn<'a>§rb: &'a MybatisImplementations§
Source§impl<'b> MyBatisConnExecutor<'b>
impl<'b> MyBatisConnExecutor<'b>
pub fn as_executor<'a>(&'a mut self) -> MyBatisExecutor<'a, 'b>
Source§impl<'a> MyBatisConnExecutor<'a>
impl<'a> MyBatisConnExecutor<'a>
pub async fn begin(self) -> Result<MyBatisTxExecutor<'a>>
Trait Implementations§
Source§impl<'a> Debug for MyBatisConnExecutor<'a>
impl<'a> Debug for MyBatisConnExecutor<'a>
Source§impl<'a> ExecutorMut for MyBatisConnExecutor<'_>
impl<'a> ExecutorMut for MyBatisConnExecutor<'_>
fn exec<'life0, 'life1, 'async_trait>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Bson>,
) -> Pin<Box<dyn Future<Output = Result<DBExecResult, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Bson>,
) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where
T: DeserializeOwned + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<'r, 'inner> From<&'r mut MyBatisConnExecutor<'inner>> for MyBatisExecutor<'r, 'inner>
impl<'r, 'inner> From<&'r mut MyBatisConnExecutor<'inner>> for MyBatisExecutor<'r, 'inner>
Source§fn from(arg: &'r mut MyBatisConnExecutor<'inner>) -> Self
fn from(arg: &'r mut MyBatisConnExecutor<'inner>) -> Self
Converts to this type from the input type.
Source§impl MappingMut for MyBatisConnExecutor<'_>
impl MappingMut for MyBatisConnExecutor<'_>
Source§fn save_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T, R>(
&'life0 mut self,
table: &'life1 T,
w: Wrapper,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
R: DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T, R>(
&'life0 mut self,
table: &'life1 T,
w: Wrapper,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<R>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
R: DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
save by wrapper, use fetch.
Source§fn save<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
table: &'life1 T,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
table: &'life1 T,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
save one entity to database
Source§fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
tables: &'life1 [T],
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_batch<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
tables: &'life1 [T],
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
save batch makes many value into only one sql. make sure your data do not too long! Read more
Source§fn save_batch_slice<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
tables: &'life1 [T],
slice_len: usize,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn save_batch_slice<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
tables: &'life1 [T],
slice_len: usize,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<DBExecResult>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
save batch slice makes many value into many sql. make sure your slice_len do not too long!
slice_len = 0 : save all data
slice_len != 0 : save data with slice_len everytime until save all data Read more
Source§fn remove_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn remove_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
remove database record by a wrapper
Source§fn remove_by_column<'life0, 'life1, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
value: P,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_by_column<'life0, 'life1, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
value: P,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
remove database record by id
Source§fn remove_batch_by_column<'life0, 'life1, 'life2, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
values: &'life2 [P],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn remove_batch_by_column<'life0, 'life1, 'life2, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
values: &'life2 [P],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
remove batch id
for Example :
rb.remove_batch_by_column::(&[“1”.to_string(),“2”.to_string()]).await;
[mybatis] Exec ==> delete from biz_activity where id IN ( ? , ? )
Source§fn update_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
table: &'life1 T,
w: Wrapper,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_by_wrapper<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
table: &'life1 T,
w: Wrapper,
skips: &'life2 [Skip<'_>],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
update_by_wrapper
skips: use &[Skip::Value(&rbson::Bson::Null), Skip::Column(“id”), Skip::Column(column)] will skip id column and null value param
Source§fn update_by_column<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
column: &'life1 str,
table: &'life2 T,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_by_column<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
column: &'life1 str,
table: &'life2 T,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
update database record by id
update sql will be skip null value and id column
Source§fn update_batch_by_column<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
column: &'life1 str,
args: &'life2 [T],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_batch_by_column<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
column: &'life1 str,
args: &'life2 [T],
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
remove batch database record by args
Source§fn fetch_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn fetch_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fetch database record by a wrapper
Source§fn fetch_count<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn fetch_count<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
count database record
Source§fn fetch_count_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn fetch_count_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
T: MybatisPlus + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
count database record by a wrapper
Source§fn fetch_by_column<'life0, 'life1, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
value: P,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_by_column<'life0, 'life1, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
value: P,
) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fetch database record by value
Source§fn fetch_list_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn fetch_list_by_wrapper<'life0, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fetch database record list by a wrapper
Source§fn fetch_list<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fn fetch_list<'life0, 'async_trait, T>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
fetch database record list for all
Source§fn fetch_list_by_column<'life0, 'life1, 'life2, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
column_values: &'life2 [P],
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_list_by_column<'life0, 'life1, 'life2, 'async_trait, T, P>(
&'life0 mut self,
column: &'life1 str,
column_values: &'life2 [P],
) -> Pin<Box<dyn Future<Output = Result<Vec<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
P: Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fetch database record list by a id array
Source§fn fetch_page_by_wrapper<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
page: &'life1 dyn IPageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_page_by_wrapper<'life0, 'life1, 'async_trait, T>(
&'life0 mut self,
w: Wrapper,
page: &'life1 dyn IPageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>>where
T: MybatisPlus + DeserializeOwned + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fetch page database record list by a wrapper
Source§fn fetch_page<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Bson>,
page_request: &'life2 dyn IPageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>>where
T: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn fetch_page<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 mut self,
sql: &'life1 str,
args: Vec<Bson>,
page_request: &'life2 dyn IPageRequest,
) -> Pin<Box<dyn Future<Output = Result<Page<T>>> + Send + 'async_trait>>where
T: DeserializeOwned + Serialize + Send + Sync + 'async_trait,
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fetch page result(prepare sql)
Source§impl MybatisRef for MyBatisConnExecutor<'_>
impl MybatisRef for MyBatisConnExecutor<'_>
fn get_mybatis(&self) -> &Mybatis
fn driver_type(&self) -> Result<DriverType>
Auto Trait Implementations§
impl<'a> !Freeze for MyBatisConnExecutor<'a>
impl<'a> !RefUnwindSafe for MyBatisConnExecutor<'a>
impl<'a> Send for MyBatisConnExecutor<'a>
impl<'a> !Sync for MyBatisConnExecutor<'a>
impl<'a> Unpin for MyBatisConnExecutor<'a>
impl<'a> !UnwindSafe for MyBatisConnExecutor<'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
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