rbatis

Rust Compile Time ORM robustness,async, pure Rust Dynamic SQL

APACHE-2.0 License

Downloads
1.1M
Stars
2.3K
Committers
25
rbatis - v1.5.5

Published by zhuxiujia about 4 years ago

v1.5.5

  • 修复了逻辑删除插件扫描不带逻辑删除字段的表时,加入了逻辑删除逻辑的BUG
  • 修复了在Linux平台下 OpenSsl依赖太古老导致启动失败的bug
  • 新增Wrapper自动check机制,使用例如fetch_by_wrapper()传入的Wrapper即使没有调用check()方法也没关系
rbatis - v1.5.3

Published by zhuxiujia about 4 years ago

v1.5.3
fix #15

rbatis - v1.5.2

Published by zhuxiujia about 4 years ago

v1.5.2

  • fix some del plugin bugs.修复修改了 ‘逻辑删除插件‘ 初始数据
rbatis - v1.5.1

Published by zhuxiujia about 4 years ago

fix [#12]

rbatis - v1.5.0

Published by zhuxiujia about 4 years ago

v1.5.0

Macro macro macro is now supported to automatically implement the CRUDEnable interface, saving a large amount of code

现已支持 macro宏自动实现CRUDEnable 接口,节省一大片代码


//toml
rbatis-macro-driver = { version = "1.5.0" }
// code
#[macro_use]
extern crate rbatis_macro_driver;

#[derive(CRUDEnable,Serialize, Deserialize, Clone, Debug)]
pub struct BizActivity {
    pub id: Option<String>,
    pub name: Option<String>,
    pub delete_flag: Option<i32>
   //...
}

pub fn test_fetch_by_id() {
    async_std::task::block_on(async {
       let rb = Rbatis::new(); 
       rb.link("mysql://root:123456@localhost:3306/test").await.unwrap();
        let r = rb.fetch_by_id::<Option<BizActivity>>("", &"1".to_string()).await.unwrap();
        println!("{}",serde_json::to_string(&r).unwrap());
    });
}

rbatis - v1.4.8

Published by zhuxiujia about 4 years ago

v1.4.8

Wrapper 增加 do_if 和 do_match 方法,方便链式调用。

do_if

        let p = Option::<i32>::Some(1);
        let w = Wrapper::new(&DriverType::Postgres)
            .do_if(p.is_some(), |w| w.eq("a", p))
            .check().unwrap();
        println!("arg:{:?}", w.args.clone());
//结果: 
//sql:"a =  $1 "
//arg:[Number(1)]

do_match

        let p = 1;
        let w = Wrapper::new(&DriverType::Postgres)
            .do_match(&[
                Case::new(p==0, |w| w.eq("a","some")),
                Case::new(p==2, |w| w.eq("a","none")),
            ], |w| w.eq("a","default"))
            .check().unwrap();
        println!("arg:{:?}", w.args.clone());
//结果: 
//sql:"a =  $1 "
//arg:[String("default")]
rbatis - v1.4.4

Published by zhuxiujia about 4 years ago

v1.4.4 LogicPlugin add custom value enable

rbatis - v1.4.3

Published by zhuxiujia about 4 years ago

v1.4.3 免去了写 Rbatis<'static> 生命周期常量,增加NativeDateTime::now()方法

rbatis - v1.4.2

Published by zhuxiujia about 4 years ago

v1.4.2 support NativeDateTime

rbatis - v1.4.1

Published by zhuxiujia about 4 years ago

v1.4.1
custom connection pool
可以自定义连接池参数

rbatis - v1.4.0

Published by zhuxiujia about 4 years ago

v1.4.0
use new version for fast_log,Double performance
use DashMap replace to SyncMap
新版使用了fast_log 1.2.3,使用了无锁队列相比老版本提高近一倍性能
使用DashMap替换了原来的SyncMap,内部使用读写锁,相对提高了性能

rbatis - v1.3.7

Published by zhuxiujia about 4 years ago

v1.3.7 wrapper not necessary append .and()

for example:

let mut m = Map::new();
      m.insert("a".to_string(), json!("1"));
    let w = Wrapper::new(&DriverType::Mysql).eq("id", 1)
          .ne("id", 1)
          .in_array("id", &[1, 2, 3])
          .not_in("id", &[1, 2, 3])
          .all_eq(&m)
          .like("name", 1)
          .or()
          .not_like("name", "asdf")
          .between("create_time", "2020-01-01 00:00:00", "2020-12-12 00:00:00")
          .group_by(&["id"])
          .order_by(true, &["id", "name"])
          .check().unwrap();

//sql =>   id =  ?  AND id <>  ?  AND id IN (  ?  ,  ?  ,  ?  ) AND id NOT IN (  ?  ,  ?  ,  ?  ) AND a =  ?  AND name LIKE '% ? %' OR  OR name NOT LIKE '% ? %' AND create_time BETWEEN  ?  AND  ?  GROUP BY id ORDER BY id ASC , name ASC
rbatis - v1.3.5

Published by zhuxiujia about 4 years ago

v1.3.5 fix page plugin bug

rbatis - v1.3.1

Published by zhuxiujia about 4 years ago

v1.3.1 fix LogicDelete Plugin
修复逻辑删除插件

rbatis - v1.2.8

Published by zhuxiujia over 4 years ago

v1.2.8
修复save方法存储为null的bug

rbatis - v1.2.7

Published by zhuxiujia over 4 years ago

v1.2.7
now we support return Option for CRUDEnable trait
for example:

     let r: Result<Option<BizActivity>, Error> = rb.fetch_by_wrapper("", &w).await;

我们现在支持 查询返回 Option 的结果类型,方便某些场景下, 查询某条记录查询不到的情况返回空值。

rbatis - v1.2.6

Published by zhuxiujia over 4 years ago

fix bugs

rbatis - v1.2.5

Published by zhuxiujia over 4 years ago

v1.2.5 fix some bugs

rbatis - v1.2.1

Published by zhuxiujia over 4 years ago

v1.2.1 add wrapper

rbatis - v1.1.3 add convert

Published by zhuxiujia over 4 years ago

v1.1.3 add convert