Skip to content
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

Merged
merged 29 commits into from
Jan 11, 2023
Merged

join查询 #122

merged 29 commits into from
Jan 11, 2023

Conversation

liangzai202204
Copy link
Contributor

No description provided.

select.go Outdated Show resolved Hide resolved
Copy link
Contributor

@flycash flycash left a 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 一起)

@flycash
Copy link
Contributor

flycash commented Jan 1, 2023

集成测试为join, left join 和 right 各写一个,然后用 t.C 来指定列。

Copy link
Contributor

@flycash flycash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As 方法使用之后,在指定列的时候,生成的列名就带上了这个别名

table.go Show resolved Hide resolved
select_test.go Show resolved Hide resolved
select_test.go Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #122 (6e39929) into dev (8fe30c3) will decrease coverage by 1.00%.
The diff coverage is 77.85%.

❗ Current head 6e39929 differs from pull request most recent head b862675. Consider uploading reports for the commit b862675 to get more accurate results

@@            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     
Impacted Files Coverage Δ
internal/model/model.go 87.61% <0.00%> (-2.58%) ⬇️
internal/test/types.go 27.27% <ø> (ø)
builder.go 75.79% <45.23%> (-7.26%) ⬇️
select.go 85.07% <76.00%> (-4.83%) ⬇️
table.go 93.16% <93.16%> (ø)
aggregate.go 96.38% <100.00%> (+0.04%) ⬆️
column.go 89.28% <100.00%> (+0.09%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@liangzai202204
Copy link
Contributor Author

集成测试\internal\integration\ select_test.go,TestMySQL8SelectJoin

@liangzai202204
Copy link
Contributor Author

mysql初始化.\script\mysql\init.sql新增建表语句

.deepsource.toml Outdated Show resolved Hide resolved
builder.go Show resolved Hide resolved
internal/integration/select_test.go Outdated Show resolved Hide resolved
internal/integration/select_test.go Show resolved Hide resolved
internal/integration/select_test.go Show resolved Hide resolved
internal/integration/select_test.go Outdated Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
@flycash
Copy link
Contributor

flycash commented Jan 10, 2023

  • check license 失败,说明你有一些新文件没有加上我们的 license 说明
  • format go code,记得调用 make check, 或者自己调用 goimports 来格式化代码
  • changelog,就是把这个合并请求加进去我们的 .CHANGELOG 里面的 develop 下面
  • deepsource,应该就是各种静态代码检查的问题,你需要进去看看。有些你觉得没必要修的,可以留言
  • codecov,这个可能是统计不准,你 rebase 一下最新的 gotomicro/eorm 的 dev 分支。(rebase 各种冲突的话,你合并一下也可以)

Copy link
Contributor

@flycash flycash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TableOf 强制要求指定别名,大体上我觉得还能接受,你觉得用户会不会觉得很麻烦?

builder.go Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
select.go Outdated Show resolved Hide resolved
Copy link
Contributor

@flycash flycash left a 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) 并且其它地方保持有别名就用别名,没别名就不用别名

这两个选择,你可以自由决策。

@flycash flycash merged commit d8add15 into ecodeclub:dev Jan 11, 2023
@flycash
Copy link
Contributor

flycash commented Jan 11, 2023

我先合并了,我自己动手微调一下

@flycash flycash linked an issue Feb 1, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eorm: JOIN 查询
3 participants