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

In orm, the Fields function is used without quotes. #2809

Closed
KevinMyDing opened this issue Jul 28, 2023 · 3 comments
Closed

In orm, the Fields function is used without quotes. #2809

KevinMyDing opened this issue Jul 28, 2023 · 3 comments
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. cannot reproduce We cannot reproduce it, it might resolved in new version or you should give more details.

Comments

@KevinMyDing
Copy link

1. What version of Go and system type/arch are you using?

go version go1.19.4 windows/amd64

2. What version of GoFrame are you using?

v2.5.1

3. Can this issue be re-produced with the latest release?

Yes

4. What did you do?

In orm, the Fields function is used without quotes, which causes pgsql to return the column does not existed error.

dao.Order.Ctx(context.Background()).Fields(
	dao.Order.Columns().UserId,
).FieldSum(dao.Order.Columns().Bonus, "Bonus").Where(
	g.Map{
		dao.Order.Columns().Status: 1,
	}).Group(dao.Order.Columns().UserId).All()
SQL:   SELECT userId,SUM("bonus") AS "Bonus" FROM "order" WHERE "status"=1 GROUP BY "userId"

ERROR:  column "userid" does not exist
@gqcn gqcn added bug It is confirmed a bug, but don't worry, we'll handle it. help wanted planned This issue/proposal is planned into our next steps. labels Oct 7, 2023
@github-actions
Copy link

github-actions bot commented Oct 7, 2023

Hello @KevinMyDing. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
你好 @KevinMyDing。我们喜欢您的提案/反馈,并希望您或其他社区成员通过拉取请求做出贡献。我们提前感谢您的贡献,并期待对其进行审查。

@oldme-git oldme-git added cannot reproduce We cannot reproduce it, it might resolved in new version or you should give more details. and removed help wanted planned This issue/proposal is planned into our next steps. labels Feb 12, 2024
@oldme-git
Copy link
Member

@gqcn connot reproduce

@oldme-git
Copy link
Member

@KevinMyDing connot reproduce
if you are sure the bug still exists, provide the table's sql and other to help us.
I am usring gf version:2.6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It is confirmed a bug, but don't worry, we'll handle it. cannot reproduce We cannot reproduce it, it might resolved in new version or you should give more details.
Projects
None yet
Development

No branches or pull requests

3 participants