/// remove database record by a wrapper
remove database record by a wrapper
remove database record by a wrapper
async fn remove_by_wrapper<T>(&self, context_id: &str, w: &Wrapper) -> Result<u64>
    where
        T: CRUDTable,
    {
        let table_name = choose_dyn_table_name::<T>(w);
        let where_sql = self.driver_type()?.make_where(&w.sql);
        let mut sql = String::new();
        if self.logic_plugin.is_some() {
            sql = self.logic_plugin.as_ref().unwrap().create_remove_sql(
                context_id,
                &self.driver_type()?,
                &table_name,
                &T::table_columns(),
                &where_sql,
            )?;
        } else {
            sql = format!(
                "{} {} {}",
                crate::sql::TEMPLATE.delete_from.value,
                table_name,
                &where_sql
            );
        }
        return Ok(self
            .exec_prepare(context_id, sql.as_str(), &w.args)
            .await?
            .rows_affected);
    }
async fn remove_by_wrapper < T > ( & self , context_id : & str , w : & Wrapper ) -> Result < u64 > where T : CRUDTable , { let table_name = choose_dyn_table_name :: < T > ( w ) ; let where_sql = self . driver_type ( ) ? . make_where ( & w . sql ) ; let mut sql = String :: new ( ) ; if self . logic_plugin . is_some ( ) { sql = self . logic_plugin . as_ref ( ) . unwrap ( ) . create_remove_sql ( context_id , & self . driver_type ( ) ? , & table_name , & T :: table_columns ( ) , & where_sql , ) ? ; } else { sql = format ! ( " " crate sql TEMPLATE delete_from value table_name where_sql ) ; } return Ok ( self . exec_prepare ( context_id , sql . as_str ( ) , & w . args ) . await ? . rows_affected ) ; }
remove database record by a wrapper
remove database record by a wrapper
&self
context_id
&str
w
&Wrapper