Comments (3)
目前APIJSON没提供case功能,还没有比较好的方式在APIJSON自动化API里做。
建议用手写SQL语句的方式,或者MyBatis这种ORM库写XML代码。
APIJSON做了以下SQL查询优化:
1.字段限制(可选)
"@column": "id,name" //只查id和name两个字段,不多不少
2.查询缓存:
例如在查询某个用户User的动态Moment列表的一次请求中
{
"[]": {
"count": 5,
"Moment": {
"@order": "date-"
},
"User": {
"id@": "/Moment/userId"
}
}
}
相同id的User只会去数据库查一次,之后都是调缓存。
3.查询预判
1)如果同时查 数据 和 数量 (可在[]对象中加query:2实现),当total <= count*page则不继续查数据库。
2)id和id{}都存在时判断id{}是否包含id,如果不包含则不去查数据库,直接返回空。
from apijson.
@Hugh0529
已支持自动化的 join。
例如
Moment INNER JOIN User LEFT JOIN Comment:
"[]":{
"join": "&/User/id@,</Comment/momentId@",
"Moment":{},
"User":{
"name?":"t",
"id@": "/Moment/userId"
},
"Comment":{
"momentId@": "/Moment/id"
}
}
详情见 通用文档/3.2 功能符/数组关键词 中的 join,感谢支持^_^
https://github.com/TommyLemon/APIJSON/blob/master/Document.md#3.2
from apijson.
新增应用层连表 APP JOIN,例如 "join":"@/User/id@",支持跨不同类型数据库,缓存粒度更细更容易命中
https://github.com/TommyLemon/APIJSON/releases/tag/3.2.0
from apijson.
Related Issues (20)
- [Bug] Script 不允许 UNKNOWN 用户的 GET 请求 HOT 3
- [Bug] sqlserver查询聚合函数出错 HOT 15
- [Bug] sqlserver 查询聚合函数出错
- [运行出错] multidatasource demo运行出错 HOT 1
- [Bug] inner join可以正常拼where条件,但是left join 不行 HOT 4
- 看起来是漏了此处代码 HOT 9
- [存储过程] 怎么调用sqlserver存储过程? HOT 10
- Cannot invoke "java.util.Map.get(Object)" because "apijson.orm.AbstractVerifier.ACCESS_FAKE_DELETE_MAP" is null HOT 5
- 6.3.0 响应驼峰格式问题 HOT 45
- [Video 视频] 简单低代码平台1-接口配置
- APIJSON Router 模式 参数 映射咨询 HOT 1
- crud复杂语句catch删除脏数据,请问有好的解决方案吗? HOT 22
- [问题] jitpack 上的springboot3版本似乎没发布成功 HOT 17
- [Ecosystem 生态] apijson-mongodb,NoSQL 数据库 MongoDB 的 APIJSON 插件
- [InfluxDB] APIJSON 新增支持时序数据库(物联网) InfluxDB
- 【CHINA TELECOM **电信】【500 强】天翼云申请了 APIJSON 相关发明专利
- APIJSON 插件 apijson-influxdb 开源,支持物联网时序数据库
- APIJSON 插件 apijson-milvus 开源,支持 AI 向量数据库 Milvus
- APIJSON 6.3 发布,阿里专家推荐・登记企业 +2
- [Bug] APIJSON-DEMO中的Function.sql父类方法名错误 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apijson.