pub struct BaseMapper<T: BaseEntity> { /* private fields */ }
Implementations§
Source§impl<T: for<'a> FromRow<'a, MySqlRow> + Send + Unpin + Debug + Serialize + BaseEntity> BaseMapper<T>
impl<T: for<'a> FromRow<'a, MySqlRow> + Send + Unpin + Debug + Serialize + BaseEntity> BaseMapper<T>
pub fn new(db: MySqlPool) -> Self
pub async fn insert(self, entity: T) -> Result<MySqlQueryResult, Error>
pub async fn insert_batch_some_column( self, entity_vec: Vec<T>, ) -> Result<MySqlQueryResult, Error>
pub async fn update_by_id(self, entity: T) -> Result<MySqlQueryResult, Error>
pub async fn update( self, entity: T, wrapper: String, ) -> Result<MySqlQueryResult, Error>
pub async fn select_page( self, page: String, wrapper: String, ) -> Result<PageData<T>, Error>
pub async fn select_list(self, wrapper: String) -> Result<Vec<T>, Error>
pub async fn select_list_custom(self, sql_str: String) -> Result<Vec<T>, Error>
pub async fn select_one(self, wrapper: String) -> Result<Option<T>, Error>
pub async fn select_one_custom( self, sql_str: String, ) -> Result<Option<T>, Error>
pub async fn select_batch_ids(self, ids: Vec<u64>) -> Result<Vec<T>, Error>
pub async fn select_by_map(self, wrapper: String) -> Result<Option<T>, Error>
pub async fn select_by_id(self, id: u64) -> Result<Option<T>, Error>
pub async fn total(self, wrapper: String) -> Result<i64, Error>
pub async fn delete_by_id(self, id: u64) -> Result<MySqlQueryResult, Error>
pub async fn delete_batch_ids( self, ids: Vec<u64>, ) -> Result<MySqlQueryResult, Error>
pub async fn delete(self, wrapper: String) -> Result<MySqlQueryResult, Error>
Trait Implementations§
Source§impl<T: Clone + BaseEntity> Clone for BaseMapper<T>
impl<T: Clone + BaseEntity> Clone for BaseMapper<T>
Source§fn clone(&self) -> BaseMapper<T>
fn clone(&self) -> BaseMapper<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<T> Freeze for BaseMapper<T>
impl<T> !RefUnwindSafe for BaseMapper<T>
impl<T> Send for BaseMapper<T>where
T: Send,
impl<T> Sync for BaseMapper<T>where
T: Sync,
impl<T> Unpin for BaseMapper<T>where
T: Unpin,
impl<T> !UnwindSafe for BaseMapper<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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