极致查询性能 sqltoy-orm-4.12.3 发版

栏目: 软件资讯 · 发布时间: 6年前

内容简介:更新内容 1、修复批量操作默认autoCommit默认为false导致分布式事务错误 范例地址:https://github.com/chenrenfei/sqltoy-showcase/tree/master/trunk/sqltoy-sharding 分库分表说明: https://chenrenfei.githu...

更新内容

1、修复批量操作默认autoCommit默认为false导致分布式事务错误

范例地址:https://github.com/chenrenfei/sqltoy-showcase/tree/master/trunk/sqltoy-sharding

分库分表说明: https://chenrenfei.github.io/sqltoy/#/sqltoy/sharding

sqltoy特点说明:

  • 支持 mysql 、postgresql、db2、oracle、sqlserver、 sqlite 、clickhouse、elasticsearch等
  • 具有JPA模式的CRUD功能(即CRUD无需写sql),无需写Dao,sqltoy提供了SqlToyLazyDao,同时提供了quickvo从数据库生成POJO。
  • 根本上杜绝了 sql 注入问题
  • 最科学的sql编写方式

* sqltoy的sql编写(支持嵌套)

select 	*
from sqltoy_device_order_info t 
where #[t.ORDER_ID=:orderId]
      #[and t.ORGAN_ID in (:authedOrganIds)]
      #[and t.STAFF_ID in (:staffIds)]
      #[and t.TRANS_DATE>=:beginDate]
      #[and t.TRANS_DATE<:endDate] 

* mybatis同样功能实现

select *
 from sqltoy_device_order_info t 
 <where>
    <if test="orderId!=null">
	and t.ORDER_ID=#{orderId}
    </if>
    <if test="authedOrganIds!=null">
	and t.ORGAN_ID in
	<foreach collection="authedOrganIds" item="order_id" separator="," open="(" close=")">  
            #{order_id}  
 	</foreach>  
    </if>
    <if test="staffIds!=null">
	and t.STAFF_ID in
	<foreach collection="staffIds" item="staff_id" separator="," open="(" close=")">  
            #{staff_id}  
 	</foreach>  
    </if>
    <if test="beginDate!=null">
	and t.TRANS_DATE>=#{beginDate}
    </if>
    <if test="endDate!=null">
	and t.TRANS_DATE<#{endDate}
    </if>
</where>
  • 缓存翻译大幅提升性能,减少多表关联,让sql直观可维护

极致查询性能 sqltoy-orm-4.12.3 发版

  • 最高等级的分页优化

极致查询性能 sqltoy-orm-4.12.3 发版

  • 支持用算法代替sql实现行列转换、同比环比、分组汇总等

极致查询性能 sqltoy-orm-4.12.3 发版

极致查询性能 sqltoy-orm-4.12.3 发版

  • 支持分库分表
  • sqltoy支持跨数据库函数自适应:一套sql可以自适应多种数据库
  • 提供了5种默认的非数据库相关的主键策略
1、shortNanoTime 22位有序安全ID,格式: 13位当前毫秒+6位纳秒+3位主机ID
2、nanoTimeId 26位有序安全ID,格式:15位:yyMMddHHmmssSSS+6位纳秒+2位(线程Id+随机数)+3位主机ID
3、uuid:32 位uuid
4、SnowflakeId 雪花算法ID
5、redisId 基于 redis  来产生规则的ID主键
  • 提供了通用字段赋值处理

极致查询性能 sqltoy-orm-4.12.3 发版

  • 提供了树形表的统一处理机制

极致查询性能 sqltoy-orm-4.12.3 发版

  • sql文件更新自动重载,便于开发阶段无需重启应用
  • 慢sql统计功能

开源地址:


以上所述就是小编给大家介绍的《极致查询性能 sqltoy-orm-4.12.3 发版》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Data Structures and Algorithms in Python

Data Structures and Algorithms in Python

Michael T. Goodrich、Roberto Tamassia、Michael H. Goldwasser / John Wiley & Sons / 2013-7-5 / GBP 121.23

Based on the authors' market leading data structures books in Java and C++, this book offers a comprehensive, definitive introduction to data structures in Python by authoritative authors. Data Struct......一起来看看 《Data Structures and Algorithms in Python》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具