Struct akita::AkitaEntityManager [−][src]
pub struct AkitaEntityManager(pub DatabasePlatform, pub AkitaConfig);
Tuple Fields
0: DatabasePlatform
1: AkitaConfig
Implementations
pub fn list<T, W>(&mut self, wrapper: &mut W) -> Result<Vec<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
W: Wrapper,
pub fn list<T, W>(&mut self, wrapper: &mut W) -> Result<Vec<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
W: Wrapper,
Get all the table of records
pub fn select_one<T, W>(
&mut self,
wrapper: &mut W
) -> Result<Option<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
W: Wrapper,
pub fn select_one<T, W>(
&mut self,
wrapper: &mut W
) -> Result<Option<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
W: Wrapper,
Get one the table of records
pub fn select_by_id<T, I>(&mut self, id: I) -> Result<Option<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
I: ToValue,
pub fn select_by_id<T, I>(&mut self, id: I) -> Result<Option<T>, AkitaError> where
T: GetTableName + GetFields + FromAkita,
I: ToValue,
Get one the table of records by id
Get table of records with page
pub fn count<T, W>(&mut self, wrapper: &mut W) -> Result<usize, AkitaError> where
T: GetTableName + GetFields,
W: Wrapper,
pub fn count<T, W>(&mut self, wrapper: &mut W) -> Result<usize, AkitaError> where
T: GetTableName + GetFields,
W: Wrapper,
Get the total count of records
pub fn remove<T, W>(&mut self, wrapper: &mut W) -> Result<(), AkitaError> where
T: GetTableName + GetFields,
W: Wrapper,
pub fn remove<T, W>(&mut self, wrapper: &mut W) -> Result<(), AkitaError> where
T: GetTableName + GetFields,
W: Wrapper,
Remove the records by wrapper.
pub fn remove_by_id<T, I>(&mut self, id: I) -> Result<(), AkitaError> where
I: ToValue,
T: GetTableName + GetFields,
pub fn remove_by_id<T, I>(&mut self, id: I) -> Result<(), AkitaError> where
I: ToValue,
T: GetTableName + GetFields,
Remove the records by id.
pub fn update<T>(
&mut self,
entity: &T,
wrapper: &mut UpdateWrapper
) -> Result<(), AkitaError> where
T: GetTableName + GetFields + ToAkita,
pub fn update<T>(
&mut self,
entity: &T,
wrapper: &mut UpdateWrapper
) -> Result<(), AkitaError> where
T: GetTableName + GetFields + ToAkita,
Update the records by wrapper.
pub fn update_by_id<T, I>(
&mut self,
entity: &T,
id: I
) -> Result<(), AkitaError> where
I: ToValue,
T: GetTableName + GetFields + ToAkita,
pub fn update_by_id<T, I>(
&mut self,
entity: &T,
id: I
) -> Result<(), AkitaError> where
I: ToValue,
T: GetTableName + GetFields + ToAkita,
Update the records by id.
pub fn save_batch<T>(&mut self, entities: &[&T]) -> Result<(), AkitaError> where
T: GetTableName + GetFields + ToAkita,
pub fn save<T>(&mut self, entity: &T) -> Result<(), AkitaError> where
T: GetTableName + GetFields + ToAkita,
pub fn save<T>(&mut self, entity: &T) -> Result<(), AkitaError> where
T: GetTableName + GetFields + ToAkita,
called multiple times when using database platform that doesn;t support multiple value
get the table from database based on this column name
pub fn set_autoincrement_value(
&mut self,
table_name: &TableName,
sequence_value: i64
) -> Result<Option<i64>, AkitaError>
pub fn set_autoincrement_value(
&mut self,
table_name: &TableName,
sequence_value: i64
) -> Result<Option<i64>, AkitaError>
set the autoincrement value of the primary column(if present) of this table. If the primary column of this table is not an autoincrement, returns Ok(None).