github rbatis/rbatis v1.8.69

latest releases: v4.5.22, v4.5.21, v4.5.20...
3 years ago

v1.8.69 中文更新日志

  • up sqlx-core to 0.5.1
  • Performance Optimization format macro,This is going to be converted to a function
#[crud_enable(formats_pg: "id:{}::uuid")] 

to

 |arg:&str|->String{
    format!("{}::uuid",arg)
}
  • Performance optimization for update_by_id() Because it use method get_id() replace Json serialization
  • Rename CRUDEnable to CRUDTable,and add get_id() method
  • add to_ids() method for all vec/map type for
   #[crud_enable]
#[derive(Clone, Debug)]
pub struct BizActivity {
    pub id: Option<String>,
    pub name: Option<String>,
}
    let biz_activitys = rbatis.fetch_list::<BizActivity>("").await.unwrap();
    /// to_ids() support HashSet.to_ids(),Vec.to_ids(),Array.to_ids(),HashMap.to_ids(),LinkedList.to_ids(),BtreeMap.to_ids()....
    let ids = biz_activitys.to_ids();
    println("{}",ids);//->   ["1","2","3"]
  • CRUD trait use of the Fetch beginning,for example:
    async fn fetch_by_id<T>(&self, context_id: &str, id: &T::IdType) -> Result<T> where  T: CRUDTable;
    async fn fetch_by_wrapper<T>(&self, context_id: &str, w: &Wrapper) -> Result<T>
    where
        T: CRUDTable;
    async fn fetch_page_by_wrapper<T>(
        &self,
        context_id: &str,
        w: &Wrapper,
        page: &dyn IPageRequest,
    ) -> Result<Page<T>> where  T: CRUDTable;
    async fn fetch_list<T>(&self, context_id: &str) -> Result<Vec<T>>  where  T: CRUDTable;
    async fn fetch_list_by_ids<T>(&self, context_id: &str, ids: &[T::IdType]) -> Result<Vec<T>>where   T: CRUDTable;
    async fn fetch_list_by_wrapper<T>(&self, context_id: &str, w: &Wrapper) -> Result<Vec<T>> where T: CRUDTable;

Don't miss a new rbatis release

NewReleases is sending notifications on new releases.