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

feat(model): add option --signable #71

Merged
merged 1 commit into from
May 31, 2023

Conversation

ShaneStevenLei
Copy link
Contributor

What type of PR is this?

feat

What this PR does / why we need it (en: English/zh: Chinese):

en: add model option --signable to detect integer field's unsigned type and adjust generated data type
zh: 添加model--signable选项,来检测整数字段的无符号类型并调整相应的数据类型

Which issue(s) this PR fixes:

Signed-off-by: stevenlei <shanestevenlei@gmail.com>
@CLAassistant
Copy link

CLAassistant commented May 30, 2023

CLA assistant check
All committers have signed the CLA.

@FGYFFFF
Copy link
Contributor

FGYFFFF commented May 31, 2023

能具体描述下该pr的行为吗?是调整 gorm 生成的内容吗?

@ShaneStevenLei
Copy link
Contributor Author

能具体描述下该pr的行为吗?是调整 gorm 生成的内容吗?

是的,调整 gorm 生成的字段类型,添加--signable选项检测数据表列中包含unsigned来调整go中生成model结构体uint类型字段。

@FGYFFFF
Copy link
Contributor

FGYFFFF commented May 31, 2023

@li-jin-gou cc,看下这个需求是否可接入~

@li-jin-gou
Copy link
Member

@ShaneStevenLei 辛苦也更新一下 cwgo 的文档哈 https://www.cloudwego.io/zh/docs/cwgo/tutorials/db/

@li-jin-gou li-jin-gou merged commit 4a754f7 into cloudwego:main May 31, 2023
@ShaneStevenLei
Copy link
Contributor Author

👌

@ShaneStevenLei ShaneStevenLei deleted the optimize/model branch May 31, 2023 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants