gf icon indicating copy to clipboard operation
gf copied to clipboard

gf gen dao: The `gf gen dao` command is too slow & its -v parameter is confusing

Open windvalley opened this issue 3 months ago • 0 comments

Go version

go version go1.23.6 darwin/amd64

GoFrame version

2.9.4

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

描述下问题:

目前gf gen dao,每次执行都会重新生成dao&do&entity文件,即使数据库表结构没有任何变化或目标文件已存在,如果这个逻辑成立的话,下面这个参数是不是就多余了: -v, --overwriteDao overwrite all dao files both inside/outside internal folder 所以我的理解是,gf gen dao 是不是应该在数据库表结构没变化时或目标文件已存在时,就不要重新生成dao&do&entity文件呢?

还有一个和上述生成逻辑不一致的问题: gf gen dao -gt 生成的table文件就只会生成一次(如果目标文件已存在就忽略生成),只有在加-v参数才会重新生成

以上比较矛盾,建议统一一下逻辑。对于数据表比较多的项目,每次都重新生成文件,命令执行效率很慢,希望能优化成只针对有变化的数据表才重新生成文件。

What did you see happen?

以上

What did you expect to see?

以上

windvalley avatar Oct 17 '25 02:10 windvalley