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

db tag lowercase? #59

Closed
jingc1413 opened this issue Nov 17, 2023 · 2 comments
Closed

db tag lowercase? #59

jingc1413 opened this issue Nov 17, 2023 · 2 comments

Comments

@jingc1413
Copy link

资询个问题:
mysql 表字字段是大写, 比如 COL_NAME

结构定义为 
type def struct{
   ColName string `db:"col_name"` 
}
这样查询是空的,大小写不匹配, 有没有类似这样 `db:"col_name";lowercase:true`用法?
@fifsky
Copy link
Member

fifsky commented Nov 17, 2023

试试

type def struct{
   ColName string `db:"COL_NAME"` 
}

@jingc1413
Copy link
Author

这样是肯定可以的
那可能是 严格区分大小写吧,我是看到gorm 有这一项,所以资询一下

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

No branches or pull requests

2 participants