Comments (2)
不支持外键。关联查询属于复合查询,需要连表查,这个时候最好还是自己写sql。即使使用ORM,涉及到多表查询,还通过外键关联时,你很可能不知道最终的sql长什么样(当然你也可以不在乎…)。不过从可维护性的角度来说,我个人还是建议你这种复杂sql还是用NamedQuery来写手。至于外键,通常情况下我不建议使用物理外键,因为随着数据量的增加,你的数据库可能分布在多节点不同实例上,这时候没法物理外键了。逻辑外键的话,可能需要加上注释来表明表之间的关系
from gendry.
明白了!
from gendry.
Related Issues (20)
- Proposal: Support `BuildInsert` receive the struct rather than map[string]interface{} HOT 5
- mysql预处理 HOT 2
- update+limit HOT 1
- update tb set amount=amount+10 模式好像没找到例子 HOT 1
- AggregateMax 聚合函数当 求某个时间(datetime)的最大值时,怎么获取结果
- Scanner 的 bind 函数不支持 当值是 time.Time 时 reflect.Scanner 接口 HOT 5
- Where 过滤能否单独开放出来 HOT 4
- builder.BuildSelect where参数传递的map[string]interface{}在生成sql的时候where顺序随机生成,导致生成sql不走索引 HOT 1
- NamedQuery 支持嵌套 map[string]interface{}, 实现过滤条件
- 是否支持MySQL关键词 HOT 2
- scanner.Scan返回错误码 HOT 3
- buildDelete不支持limit操作 HOT 1
- 请问下, BuildInsertOnDuplicate方法支持如下的sql吗? HOT 3
- 支持force index操作吗
- "[scanner]: empty result" HOT 4
- 请问可以支持UNION ALL语句吗? HOT 1
- 支持多个 or 查询 HOT 1
- scanner在go继承模式下,无法scan到父级tag HOT 1
- 请求打个最新版本的tag HOT 1
- mysql传limit句柄错误 HOT 9
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 gendry.