内容简介:开源地址: github: https://github.com/chenrenfei/sagacity-sqltoy gitee: https://gitee.com/sagacity/sagacity-sqltoy idea 插件(可在market直接检索sqltoy安装): https://gitee.com/threefish/sqltoy-idea-...
开源地址:
- github: https://github.com/chenrenfei/sagacity-sqltoy
- gitee: https://gitee.com/sagacity/sagacity-sqltoy
- idea 插件(可在market直接检索sqltoy安装): https://gitee.com/threefish/sqltoy-idea-plugins
更新内容
1、升级spring、elasticsearch、mongo依赖包的版本
2、优化对 mongodb 查询支持、改为直接通过mongoTemplate集成(原先是通过mongoDbFactory模式), 完善范例
参考范例:
https://github.com/chenrenfei/sqltoy-showcase/tree/master/trunk/sqltoy-nosql
见test下面MongoTest.java
sqltoy特点说明:
- 支持 mysql 、postgresql、db2、oracle、sqlserver、 sqlite 、clickhouse、elasticsearch、mongodb等
- 具有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直观可维护
- 最高等级的分页优化
- 支持用算法代替sql实现行列转换、同比环比、分组汇总等
- 支持分库分表
- 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主键
- 提供了通用字段赋值处理
- 提供了树形表的统一处理机制
- sql文件更新自动重载,便于开发阶段无需重启应用
- 慢sql统计功能
- 便于跟其他拓展平台集成,如报表平台、配置化服务平台
public class SqlToyContext implements ApplicationContextAware {
// 省略其他代码
/**
* @todo 提供可以动态增加解析sql片段配置的接口,并返回具体id,用于第三方平台集成,如报表平台等
* @param sqlSegment
* @return
* @throws Exception
*/
public synchronized SqlToyConfig parseSqlSegment(Object sqlSegment) throws Exception {
return scriptLoader.parseSqlSagment(sqlSegment);
}
}
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:- 一种极致性能的缓冲队列
- Apache APISIX 微服务网关极致性能架构解析
- 极致性能 sqltoy-orm-4.12.9 发版
- 极致性能 sqltoy-orm-4.12.10 发版
- 极致性能 sqltoy-orm-4.12.12 发版
- 极致性能 sqltoy-orm-4.12.14 发版
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Coding the Matrix
Philip N. Klein / Newtonian Press / 2013-7-26 / $35.00
An engaging introduction to vectors and matrices and the algorithms that operate on them, intended for the student who knows how to program. Mathematical concepts and computational problems are motiva......一起来看看 《Coding the Matrix》 这本书的介绍吧!