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

Generated update SQL does NOT use backticks for reserved keywords #57

Closed
criuss opened this issue Oct 6, 2020 · 2 comments
Closed

Generated update SQL does NOT use backticks for reserved keywords #57

criuss opened this issue Oct 6, 2020 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@criuss
Copy link

criuss commented Oct 6, 2020

I am trying to do an update of a column with a reserved word as name in mysql.

Models und set value generate invalid SQL:

type Model struct { ID: int, Load: string }
table.UPDATE(table.Load).MODELS(model{Load: "test"}).Where(...

AND

table.UPDATE(table.Load).SET(mysql.String("test")).WHERE(...

generates:

UPDATE table
SET load = 'test'
WHERE ...;

set column with value generates valid SQL:

table.UPDATE().SET(table.Load.SET(mysql.String("test"))).WHERE(...

generates the correct SQL:

UPDATE uwaa.node_status
SET `load` = 'test'
WHERE ...;
@go-jet
Copy link
Owner

go-jet commented Oct 6, 2020

Looks like a bug.

@go-jet go-jet added the bug Something isn't working label Oct 6, 2020
@go-jet go-jet added this to the Version 2.5.0 milestone May 21, 2021
@go-jet
Copy link
Owner

go-jet commented May 21, 2021

The bug is fixed in the latests v2.5.0 release.

@go-jet go-jet closed this as completed May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants