-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
join查询 #122
join查询 #122
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
貌似你没有加单元测试和集成测试?单元测试要覆盖:
- 用 t.C 这种形态来指定列,并且用在 SELECT XXX, WHERE, ON 里面,包括聚合函数,也要测试指定非法列的情况
- JOIN 的情况,包括 left join, right join, join 和复合 join(就是 join 再和 join 一起)
集成测试为join, left join 和 right 各写一个,然后用 t.C 来指定列。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As 方法使用之后,在指定列的时候,生成的列名就带上了这个别名
Codecov Report
@@ Coverage Diff @@
## dev #122 +/- ##
==========================================
- Coverage 83.97% 82.96% -1.01%
==========================================
Files 22 23 +1
Lines 1373 1644 +271
==========================================
+ Hits 1153 1364 +211
- Misses 189 237 +48
- Partials 31 43 +12
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
集成测试\internal\integration\ select_test.go,TestMySQL8SelectJoin |
mysql初始化.\script\mysql\init.sql新增建表语句 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TableOf 强制要求指定别名,大体上我觉得还能接受,你觉得用户会不会觉得很麻烦?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- TableOf(entity any, alias string)
- TableOf(entity any) 并且其它地方保持有别名就用别名,没别名就不用别名
这两个选择,你可以自由决策。
我先合并了,我自己动手微调一下 |
No description provided.