pub fn update_with_filter<T,D>(&self, t: &T, filter: Filter) -> Result<D, DbError>
        where T: IsTable + IsDao, D: IsTable + IsDao {

        let table = T::table_name();
        let dao = t.to_dao();

        let mut query = Update::table(&table);
        query.columns(&table.columns);
        for c in &table.columns{
            let v = dao.get(&c.column);
            match v{
                Some(v) => {
                    query.value(v);
                },
                None => (),
            }
        }
        query.add_filter(&filter);
        query.return_all();
        query.update(self.db)
    }
/// update the Dao with filter, return the updated Dao
update the Dao with filter, return the updated Dao
update the Dao with filter return the updated Dao
pub fn update_with_filter<T,D>(&self, t: &T, filter: Filter) -> Result<D, DbError>
        where T: IsTable + IsDao, D: IsTable + IsDao {
        let table = T::table_name();
        let dao = t.to_dao();
        let mut query = Update::table(&table);
        query.columns(&table.columns);
        for c in &table.columns{
            let v = dao.get(&c.column);
            match v{
                Some(v) => {
                    query.value(v);
                },
                None => (),
            }
        }
        query.add_filter(&filter);
        query.return_all();
        query.update(self.db)
    }
pub fn update_with_filter < T , D > ( & self , t : & T , filter : Filter ) -> Result < D , DbError > where T : IsTable + IsDao , D : IsTable + IsDao { let table = T :: table_name ( ) ; let dao = t . to_dao ( ) ; let mut query = Update :: table ( & table ) ; query . columns ( & table . columns ) ; for c in & table . columns { let v = dao . get ( & c . column ) ; match v { Some ( v ) => { query . value ( v ) ; } , None => ( ) , } } query . add_filter ( & filter ) ; query . return_all ( ) ; query . update ( self . db ) }
update the Dao with filter, return the updated Dao
update the Dao with filter return the updated Dao
&self
t
&T
filter
Filter
&self
t
&T
filter
Filter